mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-14 11:20:20 -06:00
20 lines
541 B
JavaScript
20 lines
541 B
JavaScript
const chalk = require('chalk')
|
|
|
|
module.exports = function formatFeatures (options, lead, joiner) {
|
|
const features = []
|
|
if (options.router) {
|
|
features.push('vue-router')
|
|
}
|
|
if (options.vuex) {
|
|
features.push('vuex')
|
|
}
|
|
const plugins = Object.keys(options.plugins).filter(dep => {
|
|
return dep !== '@vue/cli-service'
|
|
})
|
|
features.push.apply(features, plugins)
|
|
return features.map(dep => {
|
|
dep = dep.replace(/^(@vue\/|vue-)cli-plugin-/, '')
|
|
return `${lead || ''}${chalk.yellow(dep)}`
|
|
}).join(joiner || ', ')
|
|
}
|