What are some good css and js minimizers for production code?

21.2k views Asked by At

I'm looking for some applications or websites that minimize css and js files. Ideally, they could batch them all or if not, one at a time.

12

There are 12 answers

5
bdukes On BEST ANSWER

YUI Compressor does both JavaScript and CSS. I'm not sure if you can send it a batch of files.

You can batch process at YUI Compressor Online (yui.2clics.net), though that version only accepts JavaScript. Another Online YUI Compressor (refresh-sf.com) accepts CSS, too, but doesn't batch.

In terms of comparing the various minifiers, see jQuery : Frequently Asked Questions (FAQ) : How do I compress my code? Also, check out Microsoft Ajax Minifier.

jQuery has switched from the YUI Compressor to Google's Closure Compiler for the minified version that they distribute.

1
JPrescottSanders On

I use Packer by Dean Edwards for javascript.

0
David Snabel-Caunt On

YUI Compressor is pretty cool. You can run it as part of a build process from the command line

0
TomHastjarjanto On

I like this one from Yahoo: http://developer.yahoo.com/yui/compressor/

2
Ben Blank On

Take a look at The JavaScript CompressorRater. It does live comparisons of various minifiers (with and without gzip compression) for any JavaScript you supply it.

It also (mostly) works with CSS, though not all minifiers support it and not even all of those that do (e.g. YUI) show up correctly in the comparison table.

0
Biswanath On

Basically what you are looking is to speed up your site by reducing the size of the response.

The other thing apart from minified js and css files is you can do a http compress. Please go through this and this.

0
Kev On

If you don't mind using Perl as part of your build process, JavaScript:: and CSS::Minifier work pretty well.

0
mahalie On

YUI compressor is great.

Another tool (and my weapon of choice due to its PHP-ness) is the PHP5-based Minify project hosted on Google code. If you're on a PHP platform consider it. Rather than running your stuff through a service after the fact, you install and configure this on your webserver once and then code and comment as much as you want and minify will rebuild (reminify) your CSS and/or Javascript on the fly. Yeah. I've used it, works great!!

http://code.google.com/p/minify/

0
MikeJ On

Microsoft released their Microsoft Ajax Minifier on codeplex today. Includes an MS build task and everthing inside VS 2005/2008

0
Katz On
0
AudioBubble On

you can try the free tools from Boryi

0
Pure.Krome On

There's also a .NET port of YUI Compressor which allows you to:-

  • intergrate the minification/file combining into Visual Studio post-build events
  • intergrate into a TFS Build (including CI)
  • if you wish to just use the dll's in your own code (eg. on the fly minification).