Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Si4351233

8 Comments

Sorted by latest first Latest Oldest Best

 

@Lengel546

Check this comparison of JS & CSS minifiers to pick what suits you best -

www.phpied.com/reducing-tpayload/ www.phpied.com/css-minifiers-comparison/

10% popularity Vote Up Vote Down


 

@Si4351233

There are several very popular tools for compressing/minifying your JavaScript and CSS.


Yahoo YUI Compressor
Microsoft AJAX Minifier
Google Closure Compiler (JavaScript-only)


All are very powerful -- you can find comparisons of them quite easily. All are command line tools, so they can be easily integrated into your run automatically when you build or publish your website.

You can also find many websites that run these tool for you, which will save you the time of having to install/configure. This also helps if you aren't familiar with using command line tools.

Personally, I've always used YUI Compressor.

10% popularity Vote Up Vote Down


 

@Radia820

If you want to compress the size of your Javascript files, you can use packer.

10% popularity Vote Up Vote Down


 

@Heady270

Add all your javascript to a single file and compress it with for example jsmin(http://www.crockford.com/javascript/jsmin.html). Do this as well for your CSS but use another compression technique (removing whitespace). Since this is a boring repeating task there are scripts available that will do just this for you. I use Django and use django-assets to fully automate this process.

10% popularity Vote Up Vote Down


 

@Welton855

I use Justin Etheredge's SquishIt project. It is awesome! For asp.net only however.


It uses YUI for CSS and Javascript compression.
It supports LESS
I believe it supports Google Closure
It is ridiculously easy to use.


Read the intro to squishit blog post.

Here's some sample code that will render a single <script> tag and a single <link> tag. Both of which will point to a combined and minified JS/CSS file.

<%= Bundle.JavaScript()
.Add("~/js/jquery-1.4.2.js")
.Add("~/js/jquery-ui-1.8.1.js")
.Render("~/js/combined_#.js")
%>

<%= Bundle.Css()
.Add("~/css/reset.css")
.Add("~/css/text.css")
.Add("~/css/960.css")
.Render("~/css/combined_#.css")
%>

10% popularity Vote Up Vote Down


 

@BetL925

I highly recommend Google Closure Compiler for compressing JavaScript code. I use it personally, and it is also the official compressor used by the jQuery project.

This project can do quite a lot, but the basics are this:

java -jar closure.jar -js javascriptFile.js > javascriptFile.min.js

10% popularity Vote Up Vote Down


 

@Carla537

Minify seems to be the standard. Here is a blog post with an explanation of how to use it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme