babel-helper-annotate-as-pure
API
declare nodeOrPath: Node | NodePath;
Usage
;; // ... ;
Caveat with UglifyJS pre v3.1.0
babel-helper-annotate-as-pure
will append any existing leading comments to the #__PURE__
annotation. Versions of UglifyJS prior to v3.1.0 will ignore these annotations, as they only check the last leading comment for the annotation.
For example, using the Usage
snippet above:
In
const four = /* foo */ ;
Out
const four = /* #__PURE__ */ /* foo */ ;