Skip to content

Commit

Permalink
fix: update .npmrc for pnpm 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Oct 16, 2019
1 parent 5d2c8da commit 953a080
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/@vue/cli/lib/Creator.js
Expand Up @@ -34,6 +34,7 @@ const {
hasProjectGit,
hasYarn,
hasPnpm3OrLater,
hasPnpmVersionOrLater,
logWithSpinner,
stopSpinner,
exit,
Expand Down Expand Up @@ -223,8 +224,12 @@ module.exports = class Creator extends EventEmitter {

// generate a .npmrc file for pnpm, to persist the `shamefully-flatten` flag
if (packageManager === 'pnpm') {
const pnpmConfig = hasPnpmVersionOrLater('4.0.0')
? 'shamefully-hoist=true\n'
: 'shamefully-flatten=true\n'

await writeFileTree(context, {
'.npmrc': 'shamefully-flatten=true\n'
'.npmrc': pnpmConfig
})
}

Expand Down

0 comments on commit 953a080

Please sign in to comment.