-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37f16cc
commit 2142e1f
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { semver, loadModule } = require('@vue/cli-shared-utils') | ||
|
||
/** | ||
* Get the major Vue version that the user project uses | ||
* @param {string} cwd the user project root | ||
* @returns {2|3} | ||
*/ | ||
module.exports = function getVueMajor (cwd) { | ||
const vue = loadModule('vue', cwd) | ||
// TODO: make Vue 3 the default version | ||
const vueMajor = vue ? semver.major(vue.version) : 2 | ||
return vueMajor | ||
} |