We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
plugins
vue invoke
1 parent ede606a commit f7b4fa7Copy full SHA for f7b4fa7
packages/@vue/cli/lib/util/inferRootOptions.js
@@ -1,6 +1,6 @@
1
// Infer rootOptions for individual generators being invoked
2
// in an existing project.
3
-const { semver } = require('@vue/cli-shared-utils')
+const { semver, isPlugin } = require('@vue/cli-shared-utils')
4
module.exports = function inferRootOptions (pkg) {
5
const rootOptions = {}
6
const deps = Object.assign({}, pkg.dependencies, pkg.devDependencies)
@@ -42,5 +42,12 @@ module.exports = function inferRootOptions (pkg) {
42
rootOptions.cssPreprocessor = 'stylus'
43
}
44
45
+ rootOptions.plugins = Object.keys(deps)
46
+ .filter(isPlugin)
47
+ .reduce((plugins, name) => {
48
+ plugins[name] = {}
49
+ return plugins
50
+ }, {})
51
+
52
return rootOptions
53
0 commit comments