Skip to content

Commit f78fecc

Browse files
bestanderBYK
authored andcommitted
Update: Better comment around symlinks and workspaces (#3672)
1 parent b92c19a commit f78fecc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/package-linker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ export default class PackageLinker {
177177
}
178178
}
179179

180-
// fs copy can't copy through a symlink, so we replace those with real paths to workpsaces
181180
for (const [symlink, realpath] of symlinkPaths.entries()) {
182181
if (dest.indexOf(symlink + path.sep) === 0) {
182+
// after hoisting we end up with this structure
183+
// root/node_modules/workspace-package(symlink)/node_modules/package-a
184+
// fs.copy operations can't copy files through a symlink, so all the paths under workspace-package
185+
// need to be replaced with a real path, except for the symlink root/node_modules/workspace-package
183186
dest = dest.replace(symlink, realpath);
184187
}
185188
}

0 commit comments

Comments
 (0)