From e59b3dd4f773bfee81e9d8cbe195d13e72bf6bba Mon Sep 17 00:00:00 2001 From: Wu Haotian Date: Fri, 25 Aug 2017 17:35:44 +0800 Subject: [PATCH] Don't set `babelOptions.presets` if babelrc = true --- lib/builder/builder.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 27ec1a84ba..ed037e95ef 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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)) {