buildjs

JS/CSS files compress/optimizer

npm install buildjs
1 downloads in the last week
5 downloads in the last month

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')(__dirname);

Or if you use ExpressJS

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

Then... that's all ;)

npm loves you