Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 888
Brian Avatar asked Mar 31 '09 20:03

Brian


People also ask

How do you minify CSS and JS files?

To minify CSS, try CSSNano and csso. To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.

When should you minify a code?

Minification is the process of minimizing code and markup in your web pages and script files. It's one of the main methods used to reduce load times and bandwidth usage on websites. Minification dramatically improves site speed and accessibility, directly translating into a better user experience.

Does Minifying Javascript improve performance?

Minifying strips out all comments, superfluous white space and shortens variable names. It thus reduces download time for your JavaScript files as they are (usually) a lot smaller in filesize. So, yes it does improve performance.

What is a Minifier tool?

Minifying is a well-known code minimization or code compression technique. Minification tools are used to minimize the code by eliminating the unnecessary white space character, newline characters, and comments without affecting the functionality of your web pages.


2 Answers

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.

like image 53
bdukes Avatar answered Sep 28 '22 05:09

bdukes


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

like image 30
David Snabel-Caunt Avatar answered Sep 28 '22 03:09

David Snabel-Caunt