Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v3): do not install core plugins that have major version bumps #4712

Merged
merged 2 commits into from Oct 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/@vue/cli/lib/Creator.js
Expand Up @@ -107,9 +107,8 @@ module.exports = class Creator extends EventEmitter {
logWithSpinner(`✨`, `Creating project in ${chalk.yellow(context)}.`)
this.emit('creation', { event: 'creating' })

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