-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments are not preserved inside switch...case
#3838
Comments
@evanw any update on this issue? |
The "legal comments" mechanism isn't designed for this use case. Legal comments are intended to be present but the specifics of where they are in the source code isn't supposed to matter. Legal comments are currently supported at the statement level but these things aren't statements (specifically a What you're really asking for is for esbuild to support Istanbul's specific comment meta-language, which is not something that esbuild supports. You can read more about what supporting that would mean here: #578 (comment). It's very non-trivial. I can try treating these as expression-level comments for now (which they aren't), which will attempt to preserve them as long as minification is disabled. It still won't treat them as legal comments, but perhaps that is enough for this use case. |
When a comment is placed inside
switch
block abovecase
ordefault
it is not preserved in the transpiled code.The text was updated successfully, but these errors were encountered: