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
Switch from uglifyjs-webpack-plugin (uglify-es) to terser-webpack-plugin (terser) #7923
Comments
Yes this change was also our plan. You can go ahead and send a PR to the next branch. |
Hey @edmorley, thanks for your feature request! I was wondering if you're still going to work on this one? I could pick this one up so let me know, please. |
Hi! Thank you for the reminder, I'll take a look at this later today/tomorrow :-) |
Making the changes locally, the tests are generating hundreds of warnings of form: ...are these pre-existing on |
Yep these warnings are pre-existing in |
Not sure if it makes sense to fix it in |
How does |
Currently using babel-minify with webpack is much much slower, since babel-minify-webpack-plugin doesn't support caching or parallel mode, whereas
However as always, it's worth trying both and seeing what works best for your project. Hopefully in the future |
(Sorry that last sentence should have said |
Closing since this has been fixed on the |
This is actually not true: It seems to have been integrated into webpack 4.26, @edmorley? It made my build unusable in the process (from 10-20 seconds before this change to several minutes, and worse yet, it completely hangs my computer while it's compiling? Using Ubuntu 18.04).
But is there a way to change it back to use uglify? |
At the time of that comment this change only existed on the I would try to create a reduced testcase and file a new issue. It may help to specify |
using node@latest, @angular/cli": "^7.3.1", run command "ng build --prod". <--- Last few GCs ---> <--- JS stacktrace ---> Security context: 000000B554DA5EE1 Can we do anything other then switch off minimization? Should the comment posted as it's own issue/bug? |
Apparently WebPack builds in "terser", which is what the cool kids use. Just go with the default and simplify the configuration as well as installing fewer node modules. "babel-minify-webpack-plugin" wasn't actually being used, and babel-minify is still in beta anyway. uglifyjs, according to webpack/webpack#7923, doesn't support ES6 and depends on a package which is no longer maintained.
Feature request
What is the expected behavior?
For webpack to use the new terser-webpack-plugin instead of uglifyjs-webpack-plugin.
What is motivation or use case for adding/changing the behavior?
uglifyjs-webpack-plugin
uses uglify-es which is no longer maintained, and has been replaced by a fork called terser. The fork has incorporated a number of fixes and testcases that were left to go stale in the original project.How should this be implemented in your opinion?
Changing the default
minimizer
here to useterser-webpack-plugin
:webpack/lib/WebpackOptionsDefaulter.js
Lines 304 to 315 in 0e60343
...and update the dependency list here:
webpack/package.json
Line 30 in 0e60343
Sadly I think this needs to be called a breaking change (and thus only merged into the
next
branch), since theterser-webpack-plugin
options are named slightly differently (egterserOptions
vsuglifyOptions
).However perhaps support could be added to
terser-webpack-plugin
for checking for both option names? I don't think there are any other breaking changes (the new plugin doesn't support Node 4, but neither does webpack 4) - @fabiosantoscode / @evilebottnawi could you confirm?Are you willing to work on this yourself?
Yes - I'll open a PR.
The text was updated successfully, but these errors were encountered: