Best javascript compiler/minifier [closed] Best javascript compiler/minifier [closed] javascript javascript

Best javascript compiler/minifier [closed]


Possibly UglifyJS? It's the minifier that the jQuery project is currently using.

Check out these speed comparisons.


See the statistics src: http://axod.blogspot.ca/2010/01/google-closure-compiler-advanced-mode.html

compare JSMin, by Douglas Crockford and Yahoo! YUI

Minifier           | Bytes   |% of original| gz Bytes | gz % originalNone               | 428,264 |    100%     |   91,750 |     100%JSMin              | 249,372 |     58%     |   57,338 |     62%YUI                | 235,214 |     55%     |   55,990 |     61%Closure (STANDARD) | 219,446 |     51%     |   53,515 |     58%Closure (ADVANCED) | 166,774 |     39%     |   47,372 |     52%

Closure takes the idea of a Javascript minifier a step further. It does this by doing real compilation to remove unused code, inlines variables and rewrites code to make it as small as possible.

Just for reference, you can access the Google Closure Compiler UI here http://closure-compiler.appspot.com/home


AFAIK Closure Compiler's ADVANCED mode is the only game in town if you want global dead code removal (aka tree shaking) and optimization. Which is why projects like emscripten and ClojureScript, and Dart javascript translator use it.