oxc
oxc copied to clipboard
codegen: preserve legal comments with whitespace removal
downstream: https://github.com/rolldown/rolldown/issues/4118
when codegen minify: true, we still want to keep legal comments
https://esbuild.github.io/try/#dAAwLjI0LjAALS1taW5pZnkAYXNkZiArIC8qIEBwcmVzZXJ2ZSAqLyBiOwoKLyogQHByZXNlcnZlICovIAoKYXNkZiArIGIKCi8qIEBwcmVzZXJ2ZSAqLyAK
As a bonus: deduplicate repeated legal comments https://github.com/evanw/esbuild/commit/a54916b92c128aa0596a65bcbafcde1074acf63d
when codegen minify: true
To be more specific, the conditions are String -> AST -> Minified AST(Minifier) -> String with comments(Codegen with minify: true).