Skip to content

Commit 147f3c1

Browse files
authored
fix(v3): do not install core plugins that have major version bumps (#4712)
* fix(v3): do not install core plugins that have major version bumps * chore: remove comment [ci skip]
1 parent 84be64d commit 147f3c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/@vue/cli/lib/Creator.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ module.exports = class Creator extends EventEmitter {
107107
logWithSpinner(`✨`, `Creating project in ${chalk.yellow(context)}.`)
108108
this.emit('creation', { event: 'creating' })
109109

110-
// get latest CLI version
111-
const { latest } = await getVersions()
112-
const latestMinor = `${semver.major(latest)}.${semver.minor(latest)}.0`
110+
const { current } = await getVersions()
111+
const currentMinor = `${semver.major(current)}.${semver.minor(current)}.0`
113112
// generate package.json with plugin dependencies
114113
const pkg = {
115114
name,
@@ -128,7 +127,7 @@ module.exports = class Creator extends EventEmitter {
128127
// Other `@vue/*` packages' version may not be in sync with the cli itself.
129128
pkg.devDependencies[dep] = (
130129
preset.plugins[dep].version ||
131-
((/^@vue/.test(dep)) ? `^${latestMinor}` : `latest`)
130+
((/^@vue/.test(dep)) ? `^${currentMinor}` : `latest`)
132131
)
133132
})
134133
// write package.json

0 commit comments

Comments
 (0)