From 9fe2231b2c8364ab11e02a4d2a115f2947b3adce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=9A=E4=BC=9F?= Date: Tue, 22 Oct 2019 15:11:41 +0800 Subject: [PATCH] =?UTF-8?q?mpvue=E5=89=94=E7=95=99=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/argv.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/argv.js b/config/argv.js index 90e4983..7039bcb 100644 --- a/config/argv.js +++ b/config/argv.js @@ -101,6 +101,7 @@ function mergeArgvConfig (config) { output: argvOutput, // pathString, undefined config: argvCnf, // pathString, undefined definePlugin: argvDefinePlugin, // object, undefined + removeMpvue: argvTidyMpvue, ...resetConfig } = argv const mpType = argvComponent ? 'component' : 'page' @@ -149,6 +150,17 @@ function mergeArgvConfig (config) { } }) + // 剔除mpvue + if (argvTidyMpvue) { + config.argvConfig.externals = [ + function (context, request, callback) { + if (/^vue$/.test(request)) { + return callback(null, 'commonjs ' + request); + } + callback(); + } + ]; + } // DefinePlugin if (argvDefinePlugin) { config.argvConfig.plugins.push(new webpack.DefinePlugin(argvDefinePlugin))