Skip to content

Commit feff712

Browse files
committed
fix: load node_modules correctly
When I added exposed the node_modules attribute on nodejs_binary in bcf19e0 I didn't test this with the case where a rule in a subdirectory uses the implicit @//:node_module in a parent directory. We should use the location of the :node_modules label, not the nodejs_binary rule.
1 parent 42e4d88 commit feff712

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎internal/node.bzl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _write_loader_script(ctx):
5151
substitutions={
5252
"TEMPLATED_module_roots": "\n " + ",\n ".join(module_mappings),
5353
"TEMPLATED_entry_point": ctx.attr.entry_point,
54-
"TEMPLATED_label_package": ctx.label.package,
54+
"TEMPLATED_label_package": ctx.attr.node_modules.label.package,
5555
"TEMPLATED_workspace_name": ctx.workspace_name,
5656
},
5757
executable=True,

0 commit comments

Comments
 (0)