Closed dwightjack closed 3 years ago
Interesting - this should have been fixed by #848 - any chance you're ending up with an old version of Microbundle from npx
?
Perhaps there's a separate issue where TS is stripping the annotation.
Hi, thanks for your support. I've tried to remove package-lock and node_modules to refresh the package, but the problem persists.
I've created a minimal example repo here: https://github.com/dwightjack/demo-microbundle
In the dist
folder, I see that the comment is removed from the bundled files.
Perhaps there's a separate issue where TS is stripping the annotation.
The file in the demo repo is a plan JS file (not sure if TS parses it anyway, though).
I was trying to verify if this is a problem with terser, and I noticed that the format.comments regexp might be incorrect. I think it should be:
// note the "+" after the character set
- /^\s*([@#]__[A-Z]__\s*$|@cc_on)/
+ /^\s*([@#]__[A-Z]+__\s*$|@cc_on)/
I confirm this has been fixed in version 0.14.0.
Hello!
I am using a
/*#__PURE__*/
annotation to make a library tree shakable, but the annotation is stripped out from the build.npx microbundle --external=vue --tsconfig=./tsconfig.build.json --format=modern
I am probably doing something wrong. Any hint on how to fix this?