Skip to content

Commit 7100277

Browse files
Alex Eaglegregmagolan
authored andcommitted
fix(builtin): --nobazel_run_linker implies --bazel_patch_module_resolver
If you turn off the linker, you're reverting to earlier rules_nodejs behavior where third-party node modules can only be resolved using the patched require() function that knows where to find them
1 parent 0203c06 commit 7100277

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/node/launcher.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ for ARG in ${ALL_ARGS[@]+"${ALL_ARGS[@]}"}; do
201201
# Disable the --require node-patches (undocumented and unused; only here as an escape value)
202202
--nobazel_node_patches) NODE_PATCHES=false ;;
203203
# Disable the linker pre-process (undocumented and unused; only here as an escape value)
204-
--nobazel_run_linker) RUN_LINKER=false ;;
204+
# It also enables the --bazel_patch_module_resolver flag, as either the linker or require() patch
205+
# is needed for resolving third-party node modules.
206+
--nobazel_run_linker) RUN_LINKER=false PATCH_REQUIRE=true ;;
205207
# Let users pass through arguments to node itself
206208
--node_options=*) USER_NODE_OPTIONS+=( "${ARG#--node_options=}" ) ;;
207209
# Remaining argv is collected to pass to the program

0 commit comments

Comments
 (0)