Skip to content

Commit 776fe96

Browse files
committed
Copy .yarn directory to temporary directory
1 parent ca67362 commit 776fe96

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/makePatch.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ export function makePatch({
110110
join(resolve(packageDetails.path), "package.json"),
111111
)
112112

113-
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114-
// tslint:disable-next-line:align
115-
;[".npmrc", ".yarnrc"].forEach((rcFile) => {
116-
const rcPath = join(appPath, rcFile)
117-
if (existsSync(rcPath)) {
118-
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
119-
}
120-
})
113+
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114+
// copy .yarn directory as well to ensure installations work in yarn 2
115+
// tslint:disable-next-line:align
116+
;[".npmrc", ".yarnrc", ".yarn"].forEach((rcFile) => {
117+
const rcPath = join(appPath, rcFile)
118+
if (existsSync(rcPath)) {
119+
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
120+
}
121+
})
121122

122123
if (packageManager === "yarn") {
123124
console.info(

0 commit comments

Comments
 (0)