-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
options of minifyJs should to be reviewed #8905
Comments
This is interesting. Will need to some research @jquense do You have any thoughts on that? |
seems reasonable tho i'm not sure what it means in terms of output. at the point to which uglify is run the code is already compiled to the desired ecma, i'm not sure if uglify will go out of it's way to upscale syntax unless it's told not too? in other word's i can see uglify turning multiple |
i think that just take and copy things without think a lot of investigation from create-react-app is reasonable as it's a very used and debugged repo from Facebook! :) like explained in facebook/create-react-app#4234 (comment) put down ecma to version 5 in the compression just disable some undesirable optimisation that uglify can create so it's not actually change the version output of the code created. you can still have some ecma2016 code inside |
@jquense perhaps it generates different syntax for newer versions? E.g. some new JS syntax produces smaller output so they opt into that if they can 🤷♂️ |
@KyleAMathews correct. Terser does take opportunities to use more compact syntax if the ecma version allows it. E.g. Shorthand object properties raised in issue #9034 Here's the test documenting it:
|
Cool! Great to know. Could someone PR a fix? |
use correct option of minifyJs
related to
facebook/create-react-app#4234
to get the "why" Please read this thread upper
specify ecma: 5 like described in create-react-app to support ie11 and to avoid some bug on some browser.
The text was updated successfully, but these errors were encountered: