Skip to content

Commit

Permalink
fix: do not install core plugins that have major version bumps (#4720)
Browse files Browse the repository at this point in the history
* fix: fix version check for core plugins in v4

* fix: fix the error when the diff result is null
  • Loading branch information
sodatea committed Oct 21, 2019
1 parent 85c9cbf commit 96890b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/@vue/cli/lib/Creator.js
Expand Up @@ -129,8 +129,13 @@ module.exports = class Creator extends EventEmitter {
const { current, latest } = await getVersions()
let latestMinor = `${semver.major(latest)}.${semver.minor(latest)}.0`

// if using `next` branch of cli
if (semver.gte(current, latest) && semver.prerelease(current)) {
if (
// if the latest version contains breaking changes
/major/.test(semver.diff(current, latest)) ||
// or if using `next` branch of cli
(semver.gte(current, latest) && semver.prerelease(current))
) {
// fallback to the current cli version number
latestMinor = current
}
// generate package.json with plugin dependencies
Expand Down

0 comments on commit 96890b5

Please sign in to comment.