better way to bootstrap entry splits
now you can use multiple entry points on one page, when using a commons chunk. entry splits are entry points that are rendered as chunk because a commons chunk is used
This commit is contained in:
parent
776eabc6f1
commit
b9ce650150
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<script src="js/commons.js" charset="utf-8"></script>
|
||||
<script src="js/pageA.bundle.js" charset="utf-8"></script>
|
||||
<script src="js/pageB.bundle.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -23,7 +23,6 @@ JsonpMainTemplate.prototype.renderLocalVars = function(hash, chunk) {
|
|||
'// Array means "loading", array contains callbacks',
|
||||
"var installedChunks = {",
|
||||
this.indent(
|
||||
(chunk.ids.indexOf(0) < 0 ? "0:[function(require){require(0);}],\n" : "") +
|
||||
chunk.ids.map(function(id) {
|
||||
return id + ":0"
|
||||
}).join(",\n")
|
||||
|
@ -97,6 +96,14 @@ JsonpMainTemplate.prototype.renderInit = function(hash, chunk) {
|
|||
"}",
|
||||
"while(callbacks.length)",
|
||||
this.indent("callbacks.shift().call(null, " + this.requireFn + ");"),
|
||||
(chunk.ids.indexOf(0) < 0 ? [
|
||||
"if(0 in moreModules) {",
|
||||
this.indent([
|
||||
"installedModules[0] = 0;",
|
||||
this.requireFn + "(0);"
|
||||
]),
|
||||
"}"
|
||||
] : "")
|
||||
]),
|
||||
"};"
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue