Skip to content

Commit 55a84d1

Browse files
authored
fix: set correct linking location for yarn_install using package.json from external repository (#3442)
1 parent 7bac805 commit 55a84d1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

internal/npm_install/npm_install.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,14 @@ def _create_build_files(repository_ctx, rule_type, node, lock_file, generate_loc
449449
fail("link target must be label of form '@wksp//path/to:target', '@//path/to:target' or '//path/to:target'")
450450
validated_links[k] = v
451451

452-
package_json_dir = paths.dirname(paths.normalize(paths.join(repository_ctx.attr.package_json.package, repository_ctx.attr.package_json.name)))
452+
package_json_dir = paths.dirname(paths.normalize(paths.join(
453+
repository_ctx.attr.package_json.package,
454+
repository_ctx.attr.package_json.name,
455+
)))
453456
package_path = repository_ctx.attr.package_path
454457
if not package_path:
455458
# By default the package_path is the directory of the package.json file
456-
package_path = package_json_dir
459+
package_path = paths.join(repository_ctx.attr.package_json.workspace_root, package_json_dir)
457460
elif package_path == "/":
458461
# User specified root path
459462
package_path = ""

0 commit comments

Comments
 (0)