Don't set babelOptions.presets if babelrc = true

This commit is contained in:
Wu Haotian 2017-08-25 17:35:44 +08:00
parent cafc94d9f9
commit e59b3dd4f7
No known key found for this signature in database
GPG Key ID: 9A146A3AA793AACB

View File

@ -120,12 +120,14 @@ export default class Builder extends Tapable {
// Babel options
this.babelOptions = _.defaults(this.options.build.babel, {
presets: [
require.resolve('babel-preset-vue-app')
],
babelrc: false,
cacheDirectory: !!this.options.dev
})
if (!this.babelOptions.babelrc && !this.babelOptions.presets) {
this.babelOptions.presets = [
require.resolve('babel-preset-vue-app')
]
}
// Map postcss plugins into instances on object mode once
if (isPureObject(this.options.build.postcss)) {