views:

443

answers:

3

Hi,

Any tips on combining multiple .js files into 1 (for a build process).

Will yuicompressor do this?

+10  A: 
Dan Herbert
Nice. I didn't know YUI could handle more than one file at once.
Matthew Flaschen
+4  A: 

There's always the old standby (without compression like YUI compressor) cat file1.js file2.js > newfile.js

Darren Newton
A: 

Web Resource Optimizer for Java (wro4j) - http://code.google.com/p/wro4j/wiki/GettingStarted is created exactly for this. It can help you to keep your resources (javascripts & css) organized in a single xml, describing how you want to group them and get the merged and minimized version of it using a single request.

Also, wro4j is very configurable and has a lot of bonus features like: extensibility, easy of configuration, css variables support, runtime configuration, maven plugin for build time processing & many others.

Alex Objelean