Ensure regenerator option for babel-plugin-transform-runtime doesn't cancel out core-js polyfill
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user