-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Comments not being removed in latest esbuild #3117
Comments
Comments are removed when minifying: https://esbuild.github.io/api/#minify. Specifically with |
@evanw thanks for your quick reply - perhaps it should be more of a feature request, then, for esbuild to always remove all comments? It caught me by surprise, because at first it seemed to be removing all of the comments when I used it in Then, luckily, I checked again and found that it was removing most of the comments instead of all of the comments. It seems inconsistent to remove most rather than all, and it's also very useful to be able to use esbuild as a lightning-fast comment stripper instead of using a second tool for that. Thanks again for the incredible work you do. |
Some comments have been preserved because particular tools have particular semantics associated with them (e.g. #2721). All comments have not been preserved because doing so is a lot of work and it's not currently needed by any third-party tools that I have decided to commit to supporting.
Sorry, esbuild is not a comment stripper. Code formatting is not an intended use case for esbuild. Other tools exist for that. I'm closing this issue because I do not consider it to be a bug with esbuild. |
esbuild is not removing all comments. Simple test case:
input file (in.js) contents:
out.js contents:
esbuild is removing the third and fourth comments, but not the first and second comments.
Curiously, using
--minify
does remove all 4 comments, but using--minify-identifiers
leaves in the first and second comments.The text was updated successfully, but these errors were encountered: