mirror of https://github.com/webpack/webpack.git
commit
a0eab48f37
|
|
@ -1096,7 +1096,7 @@ class ConcatenatedModule extends Module {
|
|||
|
||||
// add harmony compatibility flag (must be first because of possible circular dependencies)
|
||||
const usedExports = this.rootModule.usedExports;
|
||||
if (usedExports === true) {
|
||||
if (usedExports === true || usedExports === null) {
|
||||
result.add(
|
||||
runtimeTemplate.defineEsModuleFlagStatement({
|
||||
exportsArgument: this.exportsArgument
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
it("should have the __esModule flag", () => {
|
||||
return import("./module").then(mod => {
|
||||
expect(mod.__esModule).toBe(true);
|
||||
expect(mod.default).toBe(84);
|
||||
})
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import other from "./other";
|
||||
|
||||
export default other * 2;
|
||||
|
|
@ -0,0 +1 @@
|
|||
export default 42;
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
it("should have the __esModule flag", () => {
|
||||
return import("./module").then(mod => {
|
||||
expect(mod.__esModule).toBe(true);
|
||||
expect(mod.default).toBe(84);
|
||||
})
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import other from "./other";
|
||||
|
||||
export default other * 2;
|
||||
|
|
@ -0,0 +1 @@
|
|||
export default 42;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
mode: "development",
|
||||
devtool: false,
|
||||
optimization: {
|
||||
concatenateModules: true
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue