Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use global regeneratorRuntime like babel #10073

Closed
littleprincewdk opened this issue Feb 21, 2025 · 1 comment
Closed

How to use global regeneratorRuntime like babel #10073

littleprincewdk opened this issue Feb 21, 2025 · 1 comment

Comments

@littleprincewdk
Copy link

Describe the feature

In my runtime, i will import a global regeneratorRuntime, but swc will use a inline _ts_generator。How to configure swc to generate:

function a() {
  return _a.apply(this, arguments);
}
function _a() {
  _a = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
    return regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return _a.apply(this, arguments);
}
});

Babel plugin or link to the feature description

No response

Additional context

No response

@kdy1
Copy link
Member

kdy1 commented Feb 27, 2025

Use external helper config

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants