Move from uglify to closure#4286
Move from uglify to closure#4286kristoferbaxter wants to merge 2 commits intoalgolia:masterfrom kristoferbaxter:closure
Conversation
|
Thanks for this initiative! I don't get the same size results for the Minified + GZipped bundle with Bundlesize:
This would mean that Uglify leads to a better GZipped bundle. Is that something that you would have expected? |
|
It's indeed pretty surprising. Maybe closure needs to be configured to remove more things? |
|
Apologies for delay: here are some results with different minfiers. Results
Based on this I'd recommend moving to compiler + terser. Future OpportunitiesThis configuration uses Closure Compiler with With a few tweaks I was able to build the source with To move to For instance, right now this fails due to invalid syntax usage in Closure would like |
|
Thanks for this analysis! We decided not to move forward with this solution for now because it involves some changes in our setup (dependencies, banners in the final bundles, stripping out comments, etc.) and the overall bundle size doesn't decrease significantly. I'm personally really excited that you made Google Closure Compiler accessible to Rollup users because it was a pain to integrate in a frontend library without this plugin. Thank you for the PR – we'll reevaluate this tool when we plan to rework on our build script. |
Move from Uglify to Closure Compiler
Result
dist/instantsearch.production.min.js: 241.09 KB/63.25 KB=>dist/instantsearch.production.min.js: 238.58 KB/62.34 KB