mirror of https://github.com/webpack/webpack.git
fixes #7930
This commit is contained in:
parent
6f1f18f84d
commit
a92c23ef76
|
@ -1447,9 +1447,9 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
|
|||
if (!used) {
|
||||
source.insert(
|
||||
-1,
|
||||
`/* unused concated harmony import ${dep.name} */\n`
|
||||
`/* unused concated harmony import ${def.name} */\n`
|
||||
);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
let finalName;
|
||||
const strictFlag = dep.originModule.buildMeta.strictHarmonyModule
|
||||
|
@ -1466,9 +1466,11 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
|
|||
}_${exportData}${strictFlag}__`;
|
||||
}
|
||||
const exportsName = this.rootModule.exportsArgument;
|
||||
const content = `/* concated harmony reexport */__webpack_require__.d(${exportsName}, ${JSON.stringify(
|
||||
used
|
||||
)}, function() { return ${finalName}; });\n`;
|
||||
const content =
|
||||
`/* concated harmony reexport ${def.name} */` +
|
||||
`__webpack_require__.d(${exportsName}, ` +
|
||||
`${JSON.stringify(used)}, ` +
|
||||
`function() { return ${finalName}; });\n`;
|
||||
source.insert(-1, content);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
export var a = 1;
|
||||
|
||||
var value = 42;
|
||||
|
||||
export { value };
|
|
@ -0,0 +1,10 @@
|
|||
import { value } from "./module";
|
||||
|
||||
it("should export the correct value", () => {
|
||||
expect(value).toBe(42);
|
||||
});
|
||||
|
||||
// prevent scope hoisting
|
||||
if(Math.random() < -1) {
|
||||
console.log(module.id);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from "./export";
|
Loading…
Reference in New Issue