Skip to content

Commit f7b4fa7

Browse files
committed
fix: rootOptions should have plugins property when calling vue invoke
1 parent ede606a commit f7b4fa7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/@vue/cli/lib/util/inferRootOptions.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Infer rootOptions for individual generators being invoked
22
// in an existing project.
3-
const { semver } = require('@vue/cli-shared-utils')
3+
const { semver, isPlugin } = require('@vue/cli-shared-utils')
44
module.exports = function inferRootOptions (pkg) {
55
const rootOptions = {}
66
const deps = Object.assign({}, pkg.dependencies, pkg.devDependencies)
@@ -42,5 +42,12 @@ module.exports = function inferRootOptions (pkg) {
4242
rootOptions.cssPreprocessor = 'stylus'
4343
}
4444

45+
rootOptions.plugins = Object.keys(deps)
46+
.filter(isPlugin)
47+
.reduce((plugins, name) => {
48+
plugins[name] = {}
49+
return plugins
50+
}, {})
51+
4552
return rootOptions
4653
}

0 commit comments

Comments
 (0)