Ensure regenerator option for babel-plugin-transform-runtime doesn't cancel out core-js polyfill
This commit is contained in:
parent
b28803c698
commit
72c091b63a
@ -24,11 +24,9 @@ export default function ({ types: t }) {
|
|||||||
|
|
||||||
visitor: {
|
visitor: {
|
||||||
ReferencedIdentifier(path, state) {
|
ReferencedIdentifier(path, state) {
|
||||||
if (state.opts.regenerator === false) return;
|
|
||||||
|
|
||||||
let { node, parent, scope } = path;
|
let { node, parent, scope } = path;
|
||||||
|
|
||||||
if (node.name === "regeneratorRuntime") {
|
if (node.name === "regeneratorRuntime" && state.opts.regenerator !== false) {
|
||||||
path.replaceWith(state.get("regeneratorIdentifier"));
|
path.replaceWith(state.get("regeneratorIdentifier"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user