Merge pull request #10146 from liximomo/fix-sideEffects
fix: bundle wrong modules
This commit is contained in:
commit
ab4fa8ddb3
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { A } from "./module";
|
||||
|
||||
it("should return the correct module", () => {
|
||||
expect(A()).toEqual("A/index.js");
|
||||
});
|
|
@ -0,0 +1,3 @@
|
|||
export default function hello() {
|
||||
return 'A/A.js'
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
export { default as A } from "./A";
|
||||
|
||||
export default function hello() {
|
||||
return 'A/index.js'
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export { default as A } from "./A";
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"sideEffects": false
|
||||
}
|
Loading…
Reference in New Issue