-
-
Notifications
You must be signed in to change notification settings - Fork 179
Turn off inlining in optimization until UglifyJS issue is fixed. #264
Comments
/cc @michael-ciniawsky what do you think about this? |
Today I ran over this issue, this would be nice to be fixed. Until then, disabling the |
+100 Couldn't agree more. |
@evilebottnawi We can disable inlining by default, there will likely be no other option in the near future 😞. This plugin will definitely become obsolete anyways if |
@michael-ciniawsky yep, let's do this, and we can improve babel-minify plugin for future 👍 |
@michael-ciniawsky i can migrate |
We've run into this issue when trying to add support for building CKEditor 5 with webpack 4 (https://github.com/ckeditor/ckeditor5-dev/issues/371). What I found is that uglify-es is not supported anymore (#262). So, in the light of this, I'd say that disabling inlining misses the point. We may soon run into another issue with uglify-es and what's then? Will we be disabling next uglify's features? |
@Reinmar we can:
|
I commented on that in #262. I know that the decision is hard, though... |
Turning off inlining by default doesn't preclude a better, longer-term solution. How long did it take you to figure out what's wrong? I have no opinion on whether to move off uglify-es; it may make sense to stay there if there's some way to bring it back into a supported status. Regardless, identifying a different ongoing solution will take time, and switching to it may require, semver-wise, a major release. (Probably) every day, poor slobs like us are losing hours of our lives chasing this down. Doesn't it make sense to put a bandaid on this now, and not make it contingent on identifying a long-term solution? Note that there's already a babel-minify-webpack-plugin, which folks may want to kick the tires on. I haven't yet. |
People, just an insight: I spent 15 hours (literally) trying to resolve a problem on my build, and I just realized that it could be Uglify after noticing that the build was working in This is critical. Builds of everyone that relies on Webpack v4 and use The error that happens is completely random, in my case, it was from React, saying: This either needs to be disabled here or even directly in Webpack source code while including the plugin in case of the |
@rdsedmundo Can you help @evilebottnawi test? I'm stuck in back-end work. |
Not sure what was supposed to be tested. But I installed the |
Should be solved after merge #296 |
Please who faced with problem test this branch, if all good please write about this here |
No, it isn't working. |
@rdsedmundo can you create issue in https://github.com/fabiosantoscode/terser? |
@evilebottnawi, everything seems to work fine on our side (https://github.com/ckeditor/ckeditor5-dev/issues/371#issuecomment-394361235). Thanks! |
👍 i think we can release new version in near future, btw feel free to feedback |
What does this fix actually do? Does uglifyjs-webpack-plugin now call UglifyJS2 with |
Bug workaround for https://github.com/fabiosantoscode/terser#replacing-uglify-es-with-terser-in-a-project-using-yarn |
When do you plan to release a new version? |
Due to a bug in UglifyJS (mishoo/UglifyJS#2842) we should disable function inlining to avoid falling into this issue. the uglifyjs-webpack-plugin module is considering to move to the maintained fork of UglifyJS (terser: https://github.com/fabiosantoscode/terser): - webpack-contrib/uglifyjs-webpack-plugin#264 - webpack-contrib/uglifyjs-webpack-plugin#296 But until that happens I'd propose to disable function inlining.
Due to a bug in UglifyJS (mishoo/UglifyJS#2842) we should disable function inlining to avoid falling into this issue. the uglifyjs-webpack-plugin module is considering to move to the maintained fork of UglifyJS (terser: https://github.com/fabiosantoscode/terser): - webpack-contrib/uglifyjs-webpack-plugin#264 - webpack-contrib/uglifyjs-webpack-plugin#296 But until that happens I'd propose to disable function inlining.
Due to a bug in UglifyJS (mishoo/UglifyJS#2842) we should disable function inlining to avoid falling into this issue. the uglifyjs-webpack-plugin module is considering to move to the maintained fork of UglifyJS (terser: https://github.com/fabiosantoscode/terser): - webpack-contrib/uglifyjs-webpack-plugin#264 - webpack-contrib/uglifyjs-webpack-plugin#296 But until that happens I'd propose to disable function inlining.
This minimization bug has been open for almost two months: mishoo/UglifyJS#2842. It has been referenced here elsewhere. The bug occurs when UglifyJS attempts to inline a call to a function with a variable of the same name as a variable in the calling function. Symptoms usually include "is not defined" or "assignment to constant variable".
In my experience, it's both easy to fall into and extremely time-consuming to diagnose.
I'd suggest turning
inline: false
in Webpack 4 until this is fixed. From the comments, it looks like UglifyJS2 is suffering from a lack of contributors with the skills and bandwidth needed to deal with things like this.All of the Webpack 4 blogging has been about "Just let us do it for you." IMHO, to fulfill the implied promise, I think you need to be reactive to component issues like this.
Related:
optimization.minimize
andoptimization.minimizer
(along with the rest ofoptimization
) need documenting.For this particular issue, I'm using:
This issue was moved from webpack/webpack#6798 by @evilebottnawi. Original issue was by @estaub.
The text was updated successfully, but these errors were encountered: