v1.26.0
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_js", version = "1.26.0")
####### Node.js version #########
# By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
# Optionally you can pin a different node version:
bazel_dep(name = "rules_nodejs", version = "5.8.2")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "16.14.2")
#################################
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
)
use_repo(npm, "npm")
Using WORKSPACE
Paste this snippet into your WORKSPACE
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_rules_js",
sha256 = "dcd1567d4a93a8634ec0b888b371a60b93c18d980f77dace02eb176531a71fcf",
strip_prefix = "rules_js-1.26.0",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.26.0/rules_js-v1.26.0.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()
What's Changed
- refactor: move npm repo rules to npm/repositories.bzl by @jbedard in #1018
- test: use unique port for js_run_devserver multirun_test by @jbedard in #1031
- chore(deps): update webpack by @renovate in #1036
- chore(deps): update dependency bazel to v6.1.2 by @renovate in #1037
- refactor: cleanup js_binary builtin env var setup by @jbedard in #1038
- docs: add docs for the public js_binary env vars by @jbedard in #1023
- chore(deps): update dependency aspect_bazel_lib to v1.31.0 by @renovate in #1039
- chore: update to Aspect CLI 5.3.4 by @gregmagolan in #1040
- feat: align js_binary+library copy_to_bin APIs by @jbedard in #1041
- refactor: update rules_oci e2e by @thesayyn in #1046
- Revert "chore(deps): update dependency aspect_bazel_lib to v1.31.0" by @alexeagle in #1052
- docs: improve documentation around verify_patches by @Aghassi in #1050
- chore(deps): update dependency aspect_bazel_lib to v1.31.1 by @renovate in #1047
- fix: when symlinking node_modules symlinks in js_run_devserer, prefer the bazel-out copy instead of the runfiles copy if it exists by @gregmagolan in #1043
- chore(deps): update webfactory/ssh-agent action to v0.8.0 by @renovate in #1003
- docs: note on how to customize the patches directory by @Aghassi in #1051
- fix: improve error message for invalid js_library(data) files by @jbedard in #1054
- feat: support custom nodejs toolchains by @jbedard in #1053
New Contributors
Full Changelog: v1.25.4...v1.26.0