node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

buildjs

BuildJS

Use this tool to compress all your assets to single file eg. all.js.

Just include it into your Node.JS project as usual module.

How to use

Add build.json file to you app's root folder

{
    "watch": true,
    "compress": true,
    "scripts": {
        "output": "media/scripts/all.js",
        "input": [
            "media/scripts/jquery.min.js",
            "media/scripts/jquery.tools.min.js",
            "media/scripts/underscore.min.js",
            "media/scripts/backbone.min.js",
            "media/scripts/main.js"
        ]
    },
    "styles": {
        "output": "media/styles/all.css",
        "input": [
            "media/styles/bootstrap.min.css",
            "media/styles/main.css"
        ]
    }
}

Then include BuildJS from your app.js

require('buildjs')();

Or if you use ExpressJS

app.configure('production', function () {
    require('buildjs')();
});

Then... that's all ;)