Merge pull request #10146 from liximomo/fix-sideEffects

fix: bundle wrong modules
This commit is contained in:
Tobias Koppers 2019-12-18 17:39:10 +01:00 committed by GitHub
commit ab4fa8ddb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 1 deletions

View File

@ -115,7 +115,7 @@ class SideEffectsFlagPlugin {
(dep instanceof HarmonyImportSpecifierDependency &&
!dep.namespaceObjectAsContext)
) {
const mapping = map.get(dep.id);
const mapping = map.get(dep._id);
if (mapping) {
dep.redirectedModule = mapping.module;
dep.redirectedId = mapping.exportName;

View File

@ -0,0 +1,5 @@
import { A } from "./module";
it("should return the correct module", () => {
expect(A()).toEqual("A/index.js");
});

View File

@ -0,0 +1,3 @@
export default function hello() {
return 'A/A.js'
}

View File

@ -0,0 +1,6 @@
export { default as A } from "./A";
export default function hello() {
return 'A/index.js'
}

View File

@ -0,0 +1 @@
export { default as A } from "./A";

View File

@ -0,0 +1,3 @@
{
"sideEffects": false
}