Javascript – combining multiple .js files into one in a build process

javascriptperformance

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

Will yuicompressor do this?

Best Solution

YUI Compressor can do this very easily, just send in the file names into YUI as arguments and it will output them as one file.

For example

> yuicompressor-2.4.2 file1.js file2.js file3.js -o combined.min.js