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
Function: nodejs_toolchain
Defines a node toolchain for a platform.
You can use this to refer to a vendored nodejs binary in your repository,
or even to compile nodejs from sources using rules_foreign_cc or other rules.
First, in a BUILD.bazel file, create a nodejs_toolchain definition:
WORKSPACE, register it with register_toolchains("//:my_nodejs")
For usage see https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains.
You can use the --toolchain_resolution_debug flag to bazel to help diagnose which toolchain is selected.
Parameters
Unique name for this target
Node.js executable
Path to Node.js executable fileThis is typically an absolute path to a non-hermetic Node.js executable.Only one of
node and node_path may be set.Npm JavaScript entry point
Path to npm JavaScript entry point.This is typically an absolute path to a non-hermetic npm installation.Only one of
npm and npm_path may be set.Additional source files required to run npm.Not necessary if specifying
npm_path to a non-hermetic npm installation.cc_library that contains the Node/v8 header files
Additional parameters
Function: node_toolchain
Deprecated. Use nodejs_toolchain instead.
Parameters
Parameters to forward to nodejs_toolchain rule.
Provider: NodeInfo
Information about how to invoke Node.js and npm.
Fields
node
Node.js executableIf set, node_path will not be set.
node_path
Path to Node.js executable; typically an absolute path to a non-hermetic Node.js.If set, node will not be set.
npm
Npm JavaScript entry point FileFor backward compability, if set then npm_path will be set to the runfiles path of npm.
npm_path
Path to npm JavaScript entry point; typically an absolute path to a non-hermetic Node.js.For backward compability, npm_path is set to the runfiles path of npm if npm is set.
npm_sources
Additional source files required to run npm
headers
Optional.
(struct) Information about the header files, with fields:
-
providers_map: a dict of string to provider instances. The key should be
a fully qualified name (e.g.
@rules_foo//bar:baz.bzl#MyInfo) of the provider to uniquely identify its type. The following keys are always present:- CcInfo: the CcInfo provider instance for the headers.
- DefaultInfo: the DefaultInfo provider instance for the headers.
cc_library) to be propagated to consumers (directly exposing a Target object can cause memory issues and is an anti-pattern). When consuming this map, it’s suggested to useproviders_map.values()to return all providers; or copy the map and filter out or replace keys as appropriate. Note that any keys begining with_(underscore) are considered private and should be forward along as-is (this better allows e.g.:current_node_cc_headersto act as the underlying headers target it represents).
target_tool_path
(DEPRECATED) Path to Node.js executable for backward compatibility
tool_files
(DEPRECATED) Alias for [node] for backward compatibility
npm_files
(DEPRECATED) Alias for npm_sources.to_list()

