diff --git a/packages/vue-cli-plugin-mpx/config/index.js b/packages/vue-cli-plugin-mpx/config/index.js index eb4641d..58006a1 100644 --- a/packages/vue-cli-plugin-mpx/config/index.js +++ b/packages/vue-cli-plugin-mpx/config/index.js @@ -1,3 +1,4 @@ +const { merge } = require('webpack-merge') const { resolveBaseRawWebpackConfig } = require('./base') const { resolvePluginWebpackConfig } = require('./plugin') @@ -16,7 +17,7 @@ function addRawConfigBeforeUserConfig (api, config) { function addPluginConfig (api, options, target, webpackConfigs) { if (target.mode === 'wx' && api.hasPlugin('mpx-plugin-mode')) { - webpackConfigs.push(resolvePluginWebpackConfig(api, webpackConfigs[0])) + webpackConfigs.push(resolvePluginWebpackConfig(api, merge({}, webpackConfigs[0]))) } }