Babel transpilation output follows. What is the purpose of generated comments like /*#__PURE__*/
?
function foo() {
return (<div>
<p></p>
<p></p>
</div>)
}
transpiles to:
"use strict";
function foo() {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null), /*#__PURE__*/React.createElement("p", null));
}
This was introduced in Babel 7:
...transpiled ES6 classes are annotated with a
/*#__PURE__*/
comment that allows gives a hint to minifiers likeUglify
andbabel-minify
for dead code elimination. These annotations are added to other helper functions as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With