Skip to content

Commit

Permalink
fix: include prereleases for assert*Version calls
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Nov 12, 2019
1 parent 6c4a0bf commit 2652ab6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/PluginAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PluginAPI {
throw new Error('Expected string or integer value.')
}

if (semver.satisfies(this.version, range)) return
if (semver.satisfies(this.version, range, { includePrerelease: true })) return

throw new Error(
`Require @vue/cli-service "${range}", but was loaded with "${this.version}".`
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/GeneratorAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class GeneratorAPI {
throw new Error('Expected string or integer value.')
}

if (semver.satisfies(this.cliVersion, range)) return
if (semver.satisfies(this.cliVersion, range, { includePrerelease: true })) return

throw new Error(
`Require global @vue/cli "${range}", but was invoked by "${this.cliVersion}".`
Expand Down Expand Up @@ -124,7 +124,7 @@ class GeneratorAPI {
throw new Error('Expected string or integer value.')
}

if (semver.satisfies(this.cliServiceVersion, range)) return
if (semver.satisfies(this.cliServiceVersion, range, { includePrerelease: true })) return

throw new Error(
`Require @vue/cli-service "${range}", but was loaded with "${this.cliServiceVersion}".`
Expand Down

0 comments on commit 2652ab6

Please sign in to comment.