views:

257

answers:

7

Possible Duplicate:
What do you use to minimize and compress JavaScript libraries?

Sometimes you'll see two different files like "jquery.1.3.2.js" and "jquery.1.3.2-min.js". The "min" version has all the whitespace and comments removed.

Is there a tool that will do that for me or do I have to do it manually?

+3  A: 

here is one way: YUI Compressor

Josh Pearce
+1  A: 

You could use YUI and Google has recently released its Closure Comiler however, the latter tends to fail with jQuery

Yacoby
+1  A: 

http://developer.yahoo.com/yui/compressor/

Jaanus
+3  A: 

The two most popular solutions are JSMin and YUI Compressor.

Jordan Ryan Moore
+1  A: 

In order to minify your Javascript code, you can use YUI Compressor or JSMin as recommended by Yahoo (http://developer.yahoo.net/blog/archives/2007/07/high%5Fperformanc%5F8.html)

Guillaume Flandre
+3  A: 

There are several tool available to do this. Just to name a few:

Joe
+7  A: 

Yes. The term you're looking for is "minify" your javascript.

Jsmin, Packer, and ShrinkSafe are all good tools. But the leader is YUI Compressor.

Rap
I wouldn't use packer anymore, as there is a cost in unpacking on every page load.
Nosredna
@Nosredna, I wish people would stop saying this about packer. It is a perfectly good minimiser. You don't have to use the base62 option, in fact it is turned off by default. It seems that people are happy to regurgitate opinions without checking the facts.
Dean Edwards