Skip to content

Commit

Permalink
docs: add note about js_binary shell script (#1897)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Aug 19, 2024
1 parent 0f479e1 commit 99d0900
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/js_binary.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions js/private/js_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Bazel option to see more detail about the selection.
All [common binary attributes](https://bazel.build/reference/be/common-definitions#common-attributes-binaries) are supported
including `args` as the list of arguments passed Node.js.
Node.js execution is performed by a shell script that sets environment variables and runs the Node.js binary with the `entry_point` script.
The shell script is located relative to the directory containing the `js_binary` at `\\{name\\}_/\\{name\\}` similar to other rulesets
such as rules_go. See [PR #1690](https://github.com/aspect-build/rules_js/pull/1690) for more information on this naming scheme.
The following environment variables are made available to the Node.js runtime based on available Bazel [Make variables](https://bazel.build/reference/be/make-variables#predefined_variables):
* JS_BINARY__BINDIR: the WORKSPACE-relative Bazel bin directory; equivalent to the `$(BINDIR)` Make variable of the `js_binary` target
Expand Down

0 comments on commit 99d0900

Please sign in to comment.