Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

Documentation for @rules_nodejs@v6.7.3 View source
Module extensions for nodejs toolchain registration in MODULE.bazel Example usage, assuming a .nvmrc file is present in the same directory as the MODULE.bazel file:
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version_from_nvmrc = "//:.nvmrc")
use_repo(node, "nodejs_toolchains")

Module extension: node

Tag: toolchain

name
name
default:"nodejs"
Base name for generated repositories
node_version
string
default:"22.22.0"
Version of the Node.js interpreter
node_version_from_nvmrc
label
default:"None"
The .nvmrc file containing the version of Node.js to use.This is recommended to ensure Bazel uses the same Node.js version as non-Bazel tooling. If set then the version found in the .nvmrc file is used instead of the one specified by node_version.
include_headers
boolean
default:"False"
Set headers field in NodeInfo provided by this toolchain.Required to compile native code into a Node.js binary. This setting creates a dependency on a c++ toolchain.
node_urls
list of strings
List of URLs to use to download Node.js.Each entry is a template for downloading a node distribution.The {version} parameter is substituted with the node_version attribute, and {filename} with the matching entry from the node_repositories attribute.
node_repositories
dictionary: String → List of strings
default:"{}"
Custom list of node repositories to useA dictionary mapping Node.js versions to sets of hosts and their corresponding (filename, strip_prefix, sha256) tuples. You should list a node binary for every platform users have, likely Mac, Windows, and Linux.By default, if this attribute has no items, we’ll use a list of all public Node.js releases.