Skip to content

Commit 4a05d83

Browse files
committed
fix(add): use symlinks in node_modules
1 parent efe5889 commit 4a05d83

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/add.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,9 @@ export const addPackages = async (
127127
}
128128
if (!doPure) {
129129
const destModulesDir = join(workingDir, 'node_modules', name)
130-
if (options.link || options.linkDep || isSymlink(destModulesDir)) {
131-
fs.removeSync(destModulesDir)
132-
}
133130

134-
if (options.link || options.linkDep) {
135-
ensureSymlinkSync(destYalcCopyDir, destModulesDir, 'junction')
136-
} else {
137-
emptyDirExcludeNodeModules(destModulesDir)
138-
fs.copySync(destYalcCopyDir, destModulesDir)
139-
}
131+
fs.removeSync(destModulesDir)
132+
ensureSymlinkSync(destYalcCopyDir, destModulesDir, 'junction')
140133

141134
if (!options.link) {
142135
const protocol = options.linkDep ? 'link:' : 'file:'

0 commit comments

Comments
 (0)