Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | exports.__esModule = true;
|
---|
| 4 | exports.default = void 0;
|
---|
| 5 |
|
---|
| 6 | var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider"));
|
---|
| 7 |
|
---|
| 8 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 9 |
|
---|
| 10 | const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
|
---|
| 11 |
|
---|
| 12 | var _default = (0, _helperDefinePolyfillProvider.default)(({
|
---|
| 13 | debug
|
---|
| 14 | }, options) => {
|
---|
| 15 | const {
|
---|
| 16 | [runtimeCompat]: {
|
---|
| 17 | useBabelRuntime
|
---|
| 18 | } = {}
|
---|
| 19 | } = options;
|
---|
| 20 | const pureName = useBabelRuntime ? `${useBabelRuntime}/regenerator` : "regenerator-runtime";
|
---|
| 21 | return {
|
---|
| 22 | name: "regenerator",
|
---|
| 23 | polyfills: ["regenerator-runtime"],
|
---|
| 24 |
|
---|
| 25 | usageGlobal(meta, utils) {
|
---|
| 26 | if (isRegenerator(meta)) {
|
---|
| 27 | debug("regenerator-runtime");
|
---|
| 28 | utils.injectGlobalImport("regenerator-runtime/runtime.js");
|
---|
| 29 | }
|
---|
| 30 | },
|
---|
| 31 |
|
---|
| 32 | usagePure(meta, utils, path) {
|
---|
| 33 | if (isRegenerator(meta)) {
|
---|
| 34 | path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime"));
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | };
|
---|
| 39 | });
|
---|
| 40 |
|
---|
| 41 | exports.default = _default;
|
---|
| 42 |
|
---|
| 43 | const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime"; |
---|
Note:
See
TracBrowser
for help on using the repository browser.