Skip to content

Commit 42007e8

Browse files
committed
fixes webpack#8666
1 parent 25bccd4 commit 42007e8

File tree

8 files changed

+28
-1
lines changed

8 files changed

+28
-1
lines changed

lib/optimize/ConcatenatedModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ class ConcatenatedModule extends Module {
10961096

10971097
// add harmony compatibility flag (must be first because of possible circular dependencies)
10981098
const usedExports = this.rootModule.usedExports;
1099-
if (usedExports === true) {
1099+
if (usedExports === true || usedExports === null) {
11001100
result.add(
11011101
runtimeTemplate.defineEsModuleFlagStatement({
11021102
exportsArgument: this.exportsArgument
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
it("should have the __esModule flag", () => {
2+
return import("./module").then(mod => {
3+
expect(mod.__esModule).toBe(true);
4+
expect(mod.default).toBe(84);
5+
})
6+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import other from "./other";
2+
3+
export default other * 2;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 42;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
it("should have the __esModule flag", () => {
2+
return import("./module").then(mod => {
3+
expect(mod.__esModule).toBe(true);
4+
expect(mod.default).toBe(84);
5+
})
6+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import other from "./other";
2+
3+
export default other * 2;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 42;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
mode: "development",
3+
devtool: false,
4+
optimization: {
5+
concatenateModules: true
6+
}
7+
};

0 commit comments

Comments
 (0)