regeneratorRuntime before v7.18.0 #15483
-
Hello, I have a strange problem about My env:
Demo git: https://github.com/Lancernix/babel-regenerator-demo |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 topicIf 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
The reason you are seeing the new behavior even with the old |
Beta Was this translation helpful? Give feedback.
regeneratorRuntime
is now a "normal Babel helper". It's behavior is similar to, for example, theclassCallCheck
helper that Babel injects when compilingclass 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
…