-
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 with side_effects option #3842
Comments
There are no bugs:
|
@alexlamsl When |
And I can't understand the source in fact... Do you mean directly remove the line 2274? |
No, I mean something like: if (compressor.option("side_effects") && seq.length > 0) {
body = body.drop_side_effect_free(compressor);
} |
@fabiosantoscode Hi~ Would you help to fix this? Maybe the same problem in terser will be fixed together? XD |
That's a pretty sane fix. Out of curiosity @alexlamsl why not gate the whole drop_side_effect_free machinery behind that check? @LongTengDao the fix should be pretty easy to implement! You already have the literal source code for it :) to be honest I don't really want to support the use case where uglified code is read by anything other than a JavaScript runtime. |
Bug report or feature request? Bug report
Uglify version (
uglifyjs -V
) 3.9.2JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.JavaScript output or error produced.
There are multi problems in the sample.
b()
disapeared/*#__PURE__*/
even when setside_effects
tofalse
, to leave it open to downstream user to make the decision. Currently, I must decide, whether to treeshake the pure calling, or miss the comment and it will never be treeshaked.Expected output
The text was updated successfully, but these errors were encountered: