Skip to content

Commit

Permalink
fix: add entry startup to fix async script chunk loading
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Apr 27, 2023
1 parent 4e25faf commit d86865c
Show file tree
Hide file tree
Showing 111 changed files with 663 additions and 287 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-boxes-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rspack/core": patch
---

fix: add entry startup to fix async script chunk loading
3 changes: 2 additions & 1 deletion crates/rspack/tests/fixtures/code-splitting/expected/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ __webpack_require__.el("./b.js").then(__webpack_require__.bind(__webpack_require
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
7 changes: 3 additions & 4 deletions crates/rspack/tests/fixtures/dynamic-import/expected/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ __webpack_require__('./child Lazy recursive ^.*.js$')("./child/".concat(request
},

};

var __webpack_require__ = require('./runtime.js');

var __webpack_require__ = require('../../../../../../../runtime.js');
__webpack_require__.C(exports)
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const a = 3;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
3 changes: 2 additions & 1 deletion crates/rspack/tests/fixtures/static-import/expected/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ console.log('hello, world');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ console.log('index');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ console.log('shared');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ console.log('shared');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index2.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index2.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ console.log('shared');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ console.log('shared');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index2.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index2.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ console.log('index');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ console.log('shared');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ _app.app;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const result = 20000;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
3 changes: 2 additions & 1 deletion crates/rspack/tests/tree-shaking/basic/expected/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const myanswer = _answer.answer;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
3 changes: 2 additions & 1 deletion crates/rspack/tests/tree-shaking/bb/expected/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ _a.ccc;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ var _default = _zh_locale.default;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.ts');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.ts'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const myanswer = 'anyser';
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ __webpack_require__.es(__webpack_require__("./bar.js"), exports);
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ __webpack_require__('./child Sync recursive ^.*.js$')(`./child/${a}.js`.replace
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const myanswer = _answer.answer;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ console.log(_foo.a);
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ console.log(_foo.a);
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ __webpack_require__.es(__webpack_require__("./something/Something.js"), exports)
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const c = 103330;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ __webpack_require__.es(__webpack_require__("./bar.js"), exports);
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ __webpack_require__.es(__webpack_require__("./bar.js"), exports);
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ console.log('something');
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ function _instanceof1(left, right) {
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ var _export = __webpack_require__("./export.js");
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ _c.c;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ var _export = __webpack_require__("./export.js");
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ var _export = __webpack_require__("./export.js");
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ _a.a;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ _a.a;
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var _export = __webpack_require__("./export.js");
},

},function(__webpack_require__) {
var __webpack_exports__ = __webpack_require__('./index.js');
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__('./index.js'));

}
]);
Loading

0 comments on commit d86865c

Please sign in to comment.