v1.32.3
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.
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_js", version = "1.32.3")
####### 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",
verify_node_modules_ignored = "//:.bazelignore",
)
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 = "66360500180584450aacf9d9876eec675263f6b9f9cb6acbc4f6a4d39099b9f7",
strip_prefix = "rules_js-1.32.3",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.3/rules_js-v1.32.3.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,
)
# For convenience, npm_translate_lock does this call automatically.
# Uncomment if you don't call npm_translate_lock at all.
#load("@bazel_features//:deps.bzl", "bazel_features_deps")
#bazel_features_deps()
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
- chore: upgrade to Aspect Workflows 5.8.0-rc4 by @gregmagolan in #1269
- Pass --arch and --platform flag to the 'lifecycle' hook to support cross-compilation (or proper download). by @sfc-gh-ptabor in #1226
- fix: don't follow symlinks to execroot by @thesayyn in #1081
- fixup: don't follow symlinks to execroot by @thesayyn in #1271
- perf: make app and node_modules layer separate actions by @thesayyn in #1268
- build: upgrade buildifier_prebuilt to 6.3.3 by @jbedard in #1273
- chore(deps): update dependency buildifier_prebuilt to v6.3.3 by @renovate in #1240
- chore(deps): update bazel by @renovate in #1219
- chore: upgrade to Aspect Workflows 5.8.0-rc6 by @gregmagolan in #1276
- chore(deps): update dependency gazelle to v0.33.0 by @renovate in #1277
- chore: upgrade to Aspect Workflows 5.8.0-rc7 by @gregmagolan in #1280
- chore: upgrade to Aspect Workflows 5.8.0-rc8 by @gregmagolan in #1282
- chore: add hot-shots to test npm packages by @gregmagolan in #1281
- fix: do not crash when parsing invalid yaml by @jbedard in #1287
- chore: set --remote_download_minimal and --nobuild_runfile_links for all Workflows tasks by @gregmagolan in #1288
- Fix for js_run_devserver to sync file changes if child process consumes stdin by @gregjacobs in #1244
- docs: fix the npm_import documentation to have the correct self-reference by @jbedard in #1289
New Contributors
- @sfc-gh-ptabor made their first contribution in #1226
Full Changelog: v1.32.2...v1.32.3