v3.4.0
Many companies are successfully building with rules_js.
If you're getting value from the project, please let us know!
Just comment on our Adoption Discussion.
Add to your MODULE.bazel file:
bazel_dep(name = "aspect_rules_js", version = "3.4.0")
# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:
bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")What's Changed
- refactor: rename node-patches to node-bootstrap, register.cjs to bootstrap.cjs by @acozzette in #2958
- feat: add js_run_binary_action helper for invoking js_binary from custom rules by @acozzette in #2956
- feat: support --bazel-bindir flag for path-mapping-compatible js_binary tools by @acozzette in #2918
- fix: js_run_binary_action drops --bazel-bindir value when outputs[0] … by @acozzette in #2960
- chore: mirror external releases by @github-actions[bot] in #2945
- refactor: expose js_run_binary_action as js_binary_lib.run_binary_action by @acozzette in #2963
- feat(js_run_binary): add support for path mapping by @acozzette in #2962
- refactor(js_run_binary): support path mapping with use_execroot_entry_point by @acozzette in #2965
- docs: add documentation on how to enable path mapping by @acozzette in #2966
- chore: mirror external releases by @github-actions[bot] in #2961
- feat(js_image_layer): add external compressor passthrough by @alexeagle in #2898
- feat(js_run_binary): add flag controlling default of set_legacy_envir… by @acozzette in #2967
- feat(nextjs): allow passing additional args to next build by @imanmalekian31 in #2947
- fix: support path-mapping with js_run_binary(stdout,stderr,exit_code_out) by @jbedard in #2968
Full Changelog: v3.3.1...v3.4.0