RSS Feed

Closure Compiler



Closure Compiler is a free service by Google for minifying JavaScript files. It's fairly easy to use - Just enter your script contents or URL, set some preferences if you like and hit "Compile" to get your minified script output on the right side.

Originally created for the Google Closure library, the Closure Compiler, in contrary to some other similar tools, is quite smart and "understands" your JavaScript, to it's able to do smart, careful changes to your code without breaking it, especially if you choose the more conservative Simple mode (Advanced mode tries to be much smarter, and therefore tend to break more scripts if the code isn't ready for it).

Notice the Closure Compiler UI isn't but a nice frontend for the underlying Closure Compiler Java Application. Apart from running it from the command line, it also provides a dead-simple REST API, which gets POST requests and return the minified results. That API is being used in numerous web optimization plugins for popular publishing frameworks such as Wordpress & Drupal.

What do you think?