Skip to content

Commit 584cf07

Browse files
committed
feat: allow omitting scope prefix for official plugins on vue add
1 parent 362587a commit 584cf07

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/@vue/cli-shared-utils/lib/pluginResolution.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ const pluginRE = /^(@vue\/|vue-|@[\w-]+\/vue-)cli-plugin-/
22
const scopeRE = /^@[\w-]+\//
33
const officialRE = /^@vue\//
44

5+
const officialPlugins = [
6+
'babel',
7+
'e2e-cypress',
8+
'e2e-nightwatch',
9+
'eslint',
10+
'pwa',
11+
'typescript',
12+
'unit-jest',
13+
'unit-mocha'
14+
]
15+
516
exports.isPlugin = id => pluginRE.test(id)
617

718
exports.isOfficialPlugin = id => exports.isPlugin(id) && officialRE.test(id)
@@ -14,6 +25,9 @@ exports.resolvePluginId = id => {
1425
if (pluginRE.test(id)) {
1526
return id
1627
}
28+
if (officialPlugins.includes(id)) {
29+
return `@vue/cli-plugin-${id}`
30+
}
1731
// scoped short
1832
// e.g. @vue/foo, @bar/foo
1933
if (id.charAt(0) === '@') {

0 commit comments

Comments
 (0)