Skip to content

regeneratorRuntime before v7.18.0 #15483

Answered by nicolo-ribaudo
Lancernix asked this question in Q&A
Discussion options

You must be logged in to vote

regeneratorRuntime is now a "normal Babel helper". It's behavior is similar to, for example, the classCallCheck helper that Babel injects when compiling class A {}:

function _createClass(Constructor, protoProps, staticProps) { /* ... */ }
function _classCallCheck(instance, Constructor) { /* ... */ }
var A = /*#__PURE__*/_createClass(function A() {
  _classCallCheck(this, A);
});

By default, Babel injects all the helpers inline to make sure that they are available.

EDIT: hiding this part of the answer because I misread your question, it's a bit off topic

If you have multiple files and you want to avoid having the same helpers duplicated in every single file where they are used, you can use

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Lancernix
Comment options

Answer selected by Lancernix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants