-
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
rfc: no comment purge #1098
Comments
Comments are by definition not part of the content. From the JavaScript standard itself:
What you are actually asking for is for esbuild to assign specific semantics to certain comments for a specific tool that you want to use, to attach those annotations to the AST according to those semantics, and then for esbuild to preserve those semantics as it compiles and transforms your code. Doing that would add a lot of work and ongoing maintenance burden and I have decided that it's out of scope. You can read more about this here: #578 (comment). |
In theory, if we had a plugin like I'm also struggling with |
I'm going to close this for the reason described above: I consider this to be out of scope. |
Problem
JavaScript/TypeScript users use comments for a variety of reasons, including the
PURE
tree shaking case.A key usage I use them for is
istanbul ...
comments, which is critical for testing & coverage. Stripping these comments makes using esbuild for testing + coverage infeasible in large codebases, where such comment flags are actually critical.Discussion
This project has a strong philosophy of keeping features low. Love it.
Is not deleting content in or out of scope for feature support? I would like to have a flag for never deleting comments. I'd advocate that we should consider this, because at the core, the current compiler is lossy. This feature isn't about supporting some new fancy language feature--it's just keeping existing content in place, especially content that is already understood and handled by the parser and printer.
The text was updated successfully, but these errors were encountered: