Skip to content

Commit 6fe7630

Browse files
committed
fix: create links relative to the target
Added link deps need to be relative to the package they're being added to, not the project root. In the past the project root was the only place you could add things but workspaces changed this.
1 parent adb7dcb commit 6fe7630

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

workspaces/arborist/lib/arborist/build-ideal-tree.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ Try using the package name instead, e.g:
514514
// This returns a promise because we might not have the name yet,
515515
// and need to call pacote.manifest to find the name.
516516
async [_add] (tree, { add, saveType = null, saveBundle = false }) {
517-
const path = this.idealTree.target.path
517+
// If we have a link it will need to be added relative to the target's path
518+
const path = tree.target.path
519+
518520
// get the name for each of the specs in the list.
519521
// ie, doing `foo@bar` we just return foo
520522
// but if it's a url or git, we don't know the name until we

0 commit comments

Comments
 (0)