Skip to content

Commit 6568f56

Browse files
authored
Merge pull request #222 from NMinhNguyen/patch-1
Support `.yarnrc` in addition to `.npmrc`
2 parents 2e9716b + 2757a6d commit 6568f56

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/makePatch.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ export function makePatch({
102102
"package.json",
103103
)).version as string
104104

105-
// copy .npmrc in case if packages are hosted in private registry
106-
const npmrcPath = join(appPath, ".npmrc")
107-
if (existsSync(npmrcPath)) {
108-
copySync(npmrcPath, join(tmpRepo.name, ".npmrc"))
109-
}
105+
// copy .npmrc/.yarnrc in case packages are hosted in private registry
106+
[".npmrc", ".yarnrc"].forEach(rcFile => {
107+
const rcPath = join(appPath, rcFile)
108+
if (existsSync(rcPath)) {
109+
copySync(rcPath, join(tmpRepo.name, rcFile))
110+
}
111+
})
110112

111113
if (packageManager === "yarn") {
112114
console.info(

0 commit comments

Comments
 (0)