fix: register injected importDeclaration (#10172)
This commit is contained in:
parent
c777e81e06
commit
075a50242d
@ -33,7 +33,8 @@ export default declare(api => {
|
|||||||
nodes.push(node);
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
path.replaceWithMultiple(nodes);
|
const [importDeclaration] = path.replaceWithMultiple(nodes);
|
||||||
|
path.scope.registerDeclaration(importDeclaration);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export foo from "bar";
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"plugins": ["proposal-export-default-from", "transform-typescript"]
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
import _foo from "bar";
|
||||||
|
export { _foo as foo };
|
||||||
@ -43,7 +43,8 @@ export default declare(api => {
|
|||||||
nodes.push(node);
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
path.replaceWithMultiple(nodes);
|
const [importDeclaration] = path.replaceWithMultiple(nodes);
|
||||||
|
path.scope.registerDeclaration(importDeclaration);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export * as foo from "bar";
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"plugins": ["proposal-export-namespace-from", "transform-typescript"]
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
import * as _foo from "bar";
|
||||||
|
export { _foo as foo };
|
||||||
Loading…
x
Reference in New Issue
Block a user