Skip to content

Commit

Permalink
feat: allow specifying additional configs in preset
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 5, 2018
1 parent 4601cc3 commit 2b9a750
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ module.exports = (api, options) => {
devDependencies: deps[options.cssPreprocessor]
})
}

// additional tooling configurations
if (options.configs) {
api.extendPackage(options.configs)
}
}
3 changes: 2 additions & 1 deletion packages/@vue/cli/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const presetSchema = createSchema(joi => joi.object().keys({
router: joi.boolean(),
vuex: joi.boolean(),
cssPreprocessor: joi.string().only(['sass', 'less', 'stylus']),
plugins: joi.object().required()
plugins: joi.object().required(),
configs: joi.object()
}))

const schema = createSchema(joi => joi.object().keys({
Expand Down

0 comments on commit 2b9a750

Please sign in to comment.