Tuesday, August 28th, 2007

Keep on squeezing with YUI Compressor

Category: Utility, Yahoo!

Julien Lecomte keeps rev’ing his new YUI Compressor with a 2.0 release.

What’s new?

I am very pleased to announce the release of version 2.0 of the YUI Compressor. In addition to fixing several bugs and implementing a few enhancements suggested by the community, I also integrated Isaac Schlueter’s regular expression based CSS minifier. Therefore, the YUI Compressor is now able to compress both JavaScript and CSS files (see the CHANGELOG for a full list of changes) And as always, keep the feedback coming!

Download the new beastie.

Posted by Dion Almaer at 3:44 am

4.5 rating from 32 votes


Comments feed TrackBack URI

Minified CSS has been a long missing feature of the web. I’ve bitched about it to Dojo before and they said that they’d consider it for Dojo 1.0.

Comment by Em — August 28, 2007

@Em – Not really. Check out: http://csstidy.sourceforge.net/

Comment by Marat Denenberg — August 28, 2007


csstidy uses a traditional parser to parse a css style sheet. This makes it ignore some hacks that people commonly use to work around browser inconsistencies and that it does not recognize i.e. the output style sheet may be different from the original one and csstidy might have introduced bugs in the process.

Comment by Julien Lecomte — August 28, 2007

@Em – I agree with Marat. Also check out http://code.google.com/p/minify/
Also, Minifying CSS is simple, just perform a big regex on the CSS. This technique has always been available, although most people still aren’t doing it.
@Julien – most CSS minify-ing parsers remove the comment hacks, but allow the rest. I think the comment hack is actually now outdated, and I’ve never found a situation where I’ve HAD to use one (many other techniques are now well known). Plus, I suppose one could go around minifying old hacked CSS, but if one is updating a site, why not update the hacks as well? Less hacks always leads to better future compatibility.

Comment by Charles — August 28, 2007

Thanks for the link. Such tools didn’t come up in my early days of searching.

Comment by Em — August 28, 2007

Version 2.1 is out and available on my blog:


Comment by Julien Lecomte — August 29, 2007

FYI, it seems latest version of JavaScript Obfuscator from Stunnix can optionally use a modified version of YUI Compressor (it can handle several files at once after their mods) and can compress JavaScript using YUI Compressor inside html files too.

Comment by davew — April 22, 2008

Leave a comment

You must be logged in to post a comment.