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

fixes missing __webpack_require__.e in concatenated modules #10133

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/optimize/ConcatenatedModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ class ConcatenatedModule extends Module {
);

this.dependencies = [];
this.blocks = [];

this.warnings = [];
this.errors = [];
Expand All @@ -348,6 +349,10 @@ class ConcatenatedModule extends Module {
)) {
this.dependencies.push(d);
}
// populate blocks
for (const d of m.blocks) {
this.blocks.push(d);
}
// populate file dependencies
if (m.buildInfo.fileDependencies) {
for (const file of m.buildInfo.fileDependencies) {
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/StatsTestCases.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ Entrypoint entry = entry.js
`;

exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = `
"Hash: 2fded77648d7f30051efea8940ce0e83e06c8e38
"Hash: 2fded77648d7f30051ef5adfc4dbbfffbf889924
Child
Hash: 2fded77648d7f30051ef
Time: Xms
Expand All @@ -2330,7 +2330,7 @@ Child
[9] ./common_lazy_shared.js 25 bytes {2} {3} {4} [built]
[10] ./common_lazy.js 25 bytes {2} {3} [built]
Child
Hash: ea8940ce0e83e06c8e38
Hash: 5adfc4dbbfffbf889924
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Entrypoint first = vendor.js first.js
Expand Down Expand Up @@ -2358,7 +2358,7 @@ Child
`;

exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = `
"Hash: 901a17990846f905bacb
"Hash: 9899fa8456a2179a8d8c
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down
2 changes: 2 additions & 0 deletions test/configCases/concatenate-modules/load-chunk-function/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "./c";
export default import("./b");
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'b';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'c';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import a from "./a";
import b from "./b";

it("should load fine", () => {
expect(b).toBe("b");
return a.then(a => expect(a).toEqual(nsObj({ default: "b" })));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import a from "./a";

it("should load fine", () => {
return a.then(a => expect(a).toEqual(nsObj({ default: "b" })));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
findBundle: function(i, options) {
return ["entry1.js", "entry2.js"];
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
entry: {
entry1: "./entry1",
entry2: "./entry2"
},
output: {
filename: "[name].js"
},
optimization: {
concatenateModules: true
}
};