-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Rollup Version
4.5.0
Operating System (or Browser)
REPL
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
The PURE annotation is not stripped. Instead all comments are considered combined or whitespace. Matching behaviour of UglifyJS starting in v3.1.0 and properly handling the output from @babel/helper-annotate-as-pure
as documented here: https://babeljs.io/docs/babel-helper-annotate-as-pure
Actual Behaviour
The following warning is thrown, and the PURE annotation is stripped.
Rollup completed with warnings:
A comment "/* #__PURE__ */" in "main.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues. [(link)](https://rollupjs.org/configuration-options/#pure)
/main.js (1:13)
1: const four = /* #__PURE__ */ /* foo */ add(2, 2);
Libraries like https://github.com/FormidableLabs/victory are currently triggering these warnings and having their annotations stripped when included in rollup projects due to this issue.
../../node_modules/victory-core/es/victory-primitives/rect.js (16:2) A comment
"/*#__PURE__*/"
in "../../node_modules/victory-core/es/victory-primitives/rect.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
../../node_modules/victory-core/es/victory-primitives/rect.js (21:2) A comment
"/*#__PURE__*/"
in "../../node_modules/victory-core/es/victory-primitives/rect.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
manelio, rodrigocfd, adrielairaldo, jannikbuschke and dominictobias-bullish