NodeJS toolchain for Bazel.
common --enable_bzlmod
in .bazelrc
.MODULE.bazel
file:bazel_dep(name = "rules_nodejs", version = "6.0.0-beta1")
Paste this snippet into your file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_nodejs",
sha256 = "d124665ea12f89153086746821cf6c9ef93ab88360a50c1aeefa1fe522421704",
strip_prefix = "rules_nodejs-6.0.0-beta1",
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.0.0-beta1/rules_nodejs-v6.0.0-beta1.tar.gz",
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/v6.0.0-beta0...v6.0.0-beta1
rules_nodejs is alive again, thanks to @jbedard who removed all the deprecated, unmaintained code.
This is a significantly smaller scope - it is only the "core" Bazel Module we used to ship in 5.x and earlier.
The 5.x
branch is your reference to the code before this removal.
common --enable_bzlmod
in .bazelrc
.MODULE.bazel
file:bazel_dep(name = "rules_nodejs", version = "6.0.0-beta0")
Paste this snippet into your file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_nodejs",
sha256 = "e53d58cf072240bba7b48c0fbd3dfaa5ebf2e005cee0bfce5f3a4ba6b813df4e",
strip_prefix = "rules_nodejs-6.0.0-beta0",
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.0.0-beta0/rules_nodejs-v6.0.0-beta0.tar.gz",
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.8.1...v6.0.0-beta0
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.7.3...5.8.1
Note: no npm packages were pushed for this release since they were unchanged since 5.8.1
WORKSPACE snippet:
http_archive(
name = "rules_nodejs",
sha256 = "764a3b3757bb8c3c6a02ba3344731a3d71e558220adcb0cf7e43c9bba2c37ba8",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-core-5.8.2.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.8.1...5.8.2
This release contains Bazel modules only, there are no accompanying npm packages because they weren't affected.
Upgrade with:
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "dcc55f810142b6cf46a44d0180a5a7fb923c04a5061e2e8d8eb05ccccc60864b",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.0/rules_nodejs-5.8.0.tar.gz"],
)
# or for core module
http_archive(
name = "rules_nodejs",
sha256 = "08337d4fffc78f7fe648a93be12ea2fc4e8eb9795a4e6aa48595b66b34555626",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.0/rules_nodejs-core-5.8.0.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.7.3...5.8.0
Update with
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "c2ad51299792d5af3b258f1dd71b3b57eff9424c2e1797d9c1d65717d95da03a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.3/rules_nodejs-5.7.3.tar.gz"],
)
# Or for the "core" module
http_archive(
name = "rules_nodejs",
sha256 = "323c780aeb0dd8e27673389362b5c67cf5fd7fde6a6d5b09a94ea9af761fc29e",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.3/rules_nodejs-core-5.7.3.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.7.2...5.7.3
Update with:
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "0e8a818724c0d5dcc10c31f9452ebd54b2ab94c452d4dcbb0d45a6636d2d5a44",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.2/rules_nodejs-5.7.2.tar.gz"],
)
# or for the "core" module
http_archive(
name = "rules_nodejs",
sha256 = "40b56e18c38295425381644f4d4efebccb5c704ac313f8baf88d047a3a6b4ab3",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.2/rules_nodejs-core-5.7.2.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.7.1...5.7.2
Update with WORKSPACE:
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "5aae76dced38f784b58d9776e4ab12278bc156a9ed2b1d9fcd3e39921dc88fda",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.1/rules_nodejs-5.7.1.tar.gz"],
)
# or for "core" module
http_archive(
name = "rules_nodejs",
sha256 = "50adf0b0ff6fc77d6909a790df02eefbbb3bc2b154ece3406361dda49607a7bd",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.1/rules_nodejs-core-5.7.1.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.7.0...5.7.1
Update WORKSPACE
:
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "c29944ba9b0b430aadcaf3bf2570fece6fc5ebfb76df145c6cdad40d65c20811",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-5.7.0.tar.gz"],
)
# or for the "core" module
http_archive(
name = "rules_nodejs",
sha256 = "33e309ba281fc73626a356a839bf5e5279360e7a2caea419c45c8017b5b3f7e2",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-core-5.7.0.tar.gz"],
)
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.6.0...5.7.0
Upgrade with
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "b011d6206e4e76696eda8287618a2b6375ff862317847cdbe38f8d0cd206e9ce",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.6.0/rules_nodejs-5.6.0.tar.gz"],
)
# or for "core" module
http_archive(
name = "rules_nodejs",
sha256 = "bce105e7a3d2a3c5eb90dcd6436544bf11f82e97073fb29e4090321ba2b84d8f",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.6.0/rules_nodejs-core-5.6.0.tar.gz"],
)
--workspaceDir
flag by @mgred in https://github.com/bazelbuild/rules_nodejs/pull/3499
Full Changelog: https://github.com/bazelbuild/rules_nodejs/compare/5.5.4...5.6.0