Project Description
ConCatJS is a simple application that is capable of recursively processing directories and concatenating the JavaScript (or CSS) files therein into a single file.

Yes, this is an alpha release right now, but I'd be really surprised if it ate your work. It does make my cat nervous, but then again ... everything makes my cat nervous.

Example:

Say you've got a project with JavaScript source in the following structure:

js\MyProject.src.js
js\MyProject.tests.js
js\MyProject\Builder.src.js
js\MyProject\Builder.tests.js
js\MyProject\Configuration.src.js
js\MyProject\Configuration.tests.js
js\MyProject\Configuration\Profile.src.js
js\MyProject\Configuration\Profile.tests.js
js\MyProject\Math.src.js
js\MyProject\Math.tests.js

Now, say you want to combine all of the .src.js files into a single file (that can later be minified with jsmin) and all of the .tests.js files into another file. That's where ConCatJS comes in!

concatjs.exe -s js -e .src.js -t js -o MyProject.js
concatjs.exe -s js -e .tests.js -t js -o MyProject.tests.js

Those two commands will recursively dig through your js directory tree and consolidate the contents of all the files matching the extension specified by the -e switch (defaults to ".js") and dump them into the file specified by the -o switch.

If you'd also like to create minified versions of your JavaScript, you can do the following:

concatjs.exe -s js -e .src.js -t js -o MyProject.js -m MyProject.min.js

ConCatJS will also handle CSS files:

concatjs.exe -s cssbuild -e .css -t css -o MyProject.css -m MyProject.min.css

The Future

This is a work in progress. I intend to add the following features very soon:
  1. Support for a .hints file that will allow the files to be assembled in a user-configured order.
  2. An ignore switch to specify one or more files to not include.
  3. A UNIX/Linux/OS X port.

Last edited Apr 4, 2011 at 10:27 PM by 484, version 6