Skip to content

Commit

Permalink
fix: handle weirdness with @babel/template
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Jan 23, 2023
1 parent a707991 commit a31be0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ export default {
})
],
external: [...builtinModules, ...Object.keys(pkg.dependencies == null ? {} : pkg.dependencies), ...Object.keys(pkg.devDependencies)]
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type {PluginItem, types, NodePath} from "@babel/core";
import template from "@babel/template";
import {REGENERATOR_SOURCE} from "../../../constant/regenerator-source.js";
const REGENERATOR_TEMPLATE = template(REGENERATOR_SOURCE)();
const REGENERATOR_TEMPLATE = "default" in template ? (template.default as (source: string) => ReturnType<typeof template>)(REGENERATOR_SOURCE)() : template(REGENERATOR_SOURCE)();

export default function (): PluginItem {
let hasInlinedRegeneratorRuntime = false;
Expand Down

0 comments on commit a31be0c

Please sign in to comment.