Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 多个子包单独使用 mpvue 构建,然后集成到一个项目中后, 造成页面重复注册的问题 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions JsonpMainTemplatePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,",
Expand All @@ -148,7 +147,6 @@ class JsonpMainTemplatePlugin {
"}"
]),
"}",
"if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);",
"while(resolves.length) {",
this.indent("resolves.shift()();"),
"}",
Expand Down Expand Up @@ -206,4 +204,4 @@ this[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`;
});
}
}
module.exports = JsonpMainTemplatePlugin;
module.exports = JsonpMainTemplatePlugin;