Closed PascalPflaum closed 7 years ago
That's interesting findings @PascalPflaum ! ✨ 💯
I am curious to see what optimisations does uglifyjs2
in comparision to babili
. The key to the gzipped result is to try and create repeating patterns. I am guessing that the latest changes broke some of these patterns for uglifyjs2
.
But that will definitely come in handy on micro optimising new features! Thanks for the effort 👍
Hi.
I figured out why UglifyJS2 was not performing as well after I merged your changes. I didn't executed the perl string stripping.
The build with UglifyJS2 is no 11 Byte smaller than using babili.
if you are interested I would add a bigger script / task runner target that would build a .gz with "n" tool chains and then picks the smallest .gz + some verbose output.
My preferred toolchain for this would be grunt + watch-plugin + a custom grunt plugin I would write for this scenario, but I'm open minded If you prefer other tools.
That sounds like an interesting idea @PascalPflaum . Can you also create an issue where we keep track of this until we have a PR?
Gulp is OK with me btw.
Ps. That's great news! This might actually help solve some problems in lifecycle branch!
17
I some research about ES6+ minifier. It looks like uglifyjs2 is the only one able to do the task right now beside babili of course. The ES6+ isn't in master yet, but there is a harmony branch, which is working fine.
I was suprised to see that the .gz build with uglify2js was 9byte smaller when I run the first test.
However after merging your latest changes uglify produces a bigger file.
I setup an alternative build target, that can be executed with "npm run build:uglify"