I want to compress my css and js files at once.Because everyday I have to modify files and deploy them.Is there any tool that will compress these files at once ?
Thanks in Advance.
I want to compress my css and js files at once.Because everyday I have to modify files and deploy them.Is there any tool that will compress these files at once ?
Thanks in Advance.
You can use YUI compressor, great tool if you have some understanding about java and command line.
The YUI Compressor is written in Java (requires Java >= 1.4) and relies on Rhino to tokenize the source JavaScript file. It starts by analyzing the source JavaScript file to understand how it is structured. It then prints out the token stream, omitting as many white space characters as possible, and replacing all local symbols by a 1 (or 2, or 3) letter symbol wherever such a substitution is appropriate (in the face of evil features such as eval or with, the YUI Compressor takes a defensive approach by not obfuscating any of the scopes containing the evil statement) The CSS compression algorithm uses a set of finely tuned regular expressions to compress the source CSS file. The YUI Compressor is open-source, so don't hesitate to look at the code to understand exactly how it works.
You probably will need two tools: one for CSS and one for Javascript. A simple shell script can chain the two into an apparently single command.
Compass is a great CSS Minify tool (Among other things)
Javascript has a few options:
http://www.crockford.com/javascript/jsmin.html
http://developer.yahoo.com/yui/compressor/
I use a simple shell script that strings a few of these tools together, and then uploads them to the web in a single command. This is all a command-line solution for Unix/Linux/Mac variants, if you need a GUI or a Windows solution I wont be of much help.
Cheers!
EDIT:
Upon further review, YUI compressor is likely a good bet for an all-in-one solution. See Anmol Saraf's answer.