Files
vue-cli/packages/@vue/cli/lib/promptModules/babel.js
Patrick 41443944c7 style: small style fixes (#3063)
* style(babel-prompt): Using else if instead of double blocks

* style(Creator): shouldInitGit doesn't need to be async
2018-12-03 20:04:17 +08:00

22 lines
530 B
JavaScript

module.exports = cli => {
cli.injectFeature({
name: 'Babel',
value: 'babel',
short: 'Babel',
description: 'Transpile modern JavaScript to older versions (for compatibility)',
link: 'https://babeljs.io/',
checked: true
})
cli.onPromptComplete((answers, options) => {
if (answers.features.includes('ts')) {
if (!answers.useTsWithBabel) {
return
}
} else if (!answers.features.includes('babel')) {
return
}
options.plugins['@vue/cli-plugin-babel'] = {}
})
}