mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-06 06:58:28 -06:00
24 lines
548 B
JavaScript
24 lines
548 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'] = {}
|
|
})
|
|
}
|