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: {
|
||||
ReferencedIdentifier(path, state) {
|
||||
if (state.opts.regenerator === false) return;
|
||||
|
||||
let { node, parent, scope } = path;
|
||||
|
||||
if (node.name === "regeneratorRuntime") {
|
||||
if (node.name === "regeneratorRuntime" && state.opts.regenerator !== false) {
|
||||
path.replaceWith(state.get("regeneratorIdentifier"));
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user