Skip to content

Commit

Permalink
fixes #10104
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Dec 17, 2019
1 parent df9f3eb commit c81963b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 3 deletions.
5 changes: 5 additions & 0 deletions lib/optimize/ConcatenatedModule.js
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
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
@@ -0,0 +1,2 @@
import "./c";
export default import("./b");
@@ -0,0 +1 @@
export default 'b';
@@ -0,0 +1 @@
export default 'c';
@@ -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" })));
});
@@ -0,0 +1,5 @@
import a from "./a";

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

0 comments on commit c81963b

Please sign in to comment.