From 71061ba321fbd72b442d6ad801ee705e078285db Mon Sep 17 00:00:00 2001 From: theYY Date: Thu, 29 Nov 2018 10:04:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=AD=90=E5=8C=85=E5=8D=95=E7=8B=AC=E4=BD=BF=E7=94=A8=20mpvue?= =?UTF-8?q?=20=E6=9E=84=E5=BB=BA=EF=BC=8C=E7=84=B6=E5=90=8E=E9=9B=86?= =?UTF-8?q?=E6=88=90=E5=88=B0=E4=B8=80=E4=B8=AA=E9=A1=B9=E7=9B=AE=E4=B8=AD?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=20=E9=80=A0=E6=88=90=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=B3=A8=E5=86=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 多个子包单独使用 mpvue 构建,然后集成到一个项目中后, 造成页面重复注册的问题,删除调用与声明 --- JsonpMainTemplatePlugin.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/JsonpMainTemplatePlugin.js b/JsonpMainTemplatePlugin.js index 8f74a42..1c96f61 100644 --- a/JsonpMainTemplatePlugin.js +++ b/JsonpMainTemplatePlugin.js @@ -126,7 +126,6 @@ class JsonpMainTemplatePlugin { source, "", "// install a JSONP callback for chunk loading", - `var parentJsonpFunction = global[${JSON.stringify(jsonpFunction)}];`, `global[${JSON.stringify(jsonpFunction)}] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {`, this.indent([ "// add \"moreModules\" to the modules object,", @@ -148,7 +147,6 @@ class JsonpMainTemplatePlugin { "}" ]), "}", - "if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);", "while(resolves.length) {", this.indent("resolves.shift()();"), "}", @@ -206,4 +204,4 @@ this[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`; }); } } -module.exports = JsonpMainTemplatePlugin; \ No newline at end of file +module.exports = JsonpMainTemplatePlugin;