MinifyMe, a minimizer for CSS and Javascript
Update 2: I hope I helped a lot of people with this project, but I havent found time to work on this project for more than three years. :) If you are looking for something similar to this project that’s actively developed see http://livereload.com/
Update: Thanks everyone for the feedback! I decided to open source the project on Google Code. Right now I am refactoring but I have put a new version on the new projects homepage:
http://code.google.com/p/minifyme/
The new version includes a button to recompress the last set of css files. Something that I wanted to put in for a long time.
If anyone has suggestions please let me know.
A few days ago I was reading about minimizing CSS files on the Yahoo Developer best pratices website. They say its better to combine css and javascript files in one file.
“80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.” Source: Yahoo
Yahoo made a tool called Compressor. With this tool it’s posible to compress css and js files. Unfortunately it’s a geeky commandline application and not everybody is capable of working with such a tool. For those people I made a small application myself called MinifyMe in Adobe AIR.

If you look in the image above you see that the application created a pack.css which contains the code of all 4 css files.
Update: I got a lot of feedback from Smashing Magazine readers, thank you all for that! Many of you were thinking I used the Yahoo Compressor, but unfortunately that’s not the case, simply because it isn’t possible to make such external call from AIR. What I basically do is combine all selected files, and then remove new lines and (some) whitespaces.
THE COMMENTS:
What panosru said 19 days later:
Hi, very nice mini application made by yourself i like the idea! Is it possible to publish the source code so other people (like me :P) may be interest to add some preferences into it?
Also also, for a 100kb JS file it saves 4kb only (96kb as a result) for a 12kb js file it saves nothing in KB (a bit of Bytes only), for the same 12kb file using the command "java -jar yuicompressor.jar jq.code.js -o jq.min.js" file reduced on 8kb so 4kb saved! So if for a 12kb js file we save 4kb for a 100kb js file we would save 33,333 kb! :D
I found it very strange as your application simple uses the yui compressor so i saw the output and realized that using the command line, spaces was strip out but using minifyMe spaces remains in file, so that explain the deference in size by using command line and minifyMe.
PS: Providing the source it would be very nice, except if you want to commercialize the application…
What Bryce said 20 days later:
This is really useful, thankyou!
What h-a-r-v said 20 days later:
Nice one, however I'd like to be allowed to control it a little just like I am here: http://refresh-sf.com/yui/
Also, I'd like to be given an option whether all the files I drop should be merged or just minified at one take (producing more than just one pack.js file in the end, but still allowing to compress more than just one file using same options). I think that's important especially that – according to the famous Yahoo like given – minification is compression, while merging files is >> obfuscation < #000 – that'd be nice, but it's not a must for it's the coder's duty in the first place.
Anyway, great job :-)
What h-a-r-v said 20 days later:
Oh, I didn't notice panosru has already pointed out the spaces problem in general. Yeah, there are more of them. Do something about it!
What jankees said 20 days later:
Thanks for all the comments!! This project was a small experiment for me. It isn't as good as Compressor. It just combines files and removes the newlines and some spaces.
It saves me some time when developing. I Just drop the css files and it works.
When I have some spare time I'll try to improve it. If you send me an email I'll keep you informed. My email is jankees [at] base42.nl.
What panosru said 20 days later:
hello again jankees, i send you an email with some ideas i have about the improvement of your application! I hope to hear from you soon! :D
What Jake said 20 days later:
Question: Does AIR allow for easy config changes? The reason I ask is I would like the app to save the file as "styles-min.css" for CSS. If there was an easy way to save that to a preferences/config that would be great.
What Billee D. said 26 days later:
Just thought that I would point out an installation error I encountered while trying to install the AIR app. It gets to about the 50% mark and informs me that the version of AIR used for the app is outdated and never finishes installing.
Just heads-up for you. Thanks for a great tool!
What tohin said 46 days later:
Thanks a lot. Cause it really helped me out. trust me .. it did. I am looking forward for some nice updates.
What Dave Redfern said 361 days later:
Hello,
Really nice and helpful little app. One thing I noticed is it doesn't strip comments.
Dave.
What Jankees said 361 days later:
Hi Dave,
Thanks for the comment! You are right, it should remove the comments! In a few weeks I will try to create an update of the tool!!
Best,
What Patrick said 1317 days later:
It doenst strip comments and it doesnt strip leading spaces so is useless.
This program only removes the newlines.
What have I said 1365 days later:
I don’t know…