1.0.13 • Published 9 years ago

bundler.js v1.0.13

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

bundler.js

Tool to produce application bundles

bundler.js is great and easy to use tool to produce application bundles.

NPM

Installation

$ npm install bundler.js

If you want to use bundler.js from terminal, you should install it globally:

$ npm install -g bundler.js

API Usage Examples

var bundler = require('bundler.js'),
    actions = {
        flushAssetsList: function(file, config, info, bundleDirs, bundlerActions){
            fs.writeFileSync(bundleDirs.destination + info.pathTo, JSON.stringify({assets: list}));
            list = [];
            console.log('FLUSH ASSETS LIST: ' + bundleDirs.destination + info.pathTo);
            console.log();
        },
        listAsset: function(file, config, info, bundleDirs, bundlerActions){
            list.push(info);
        },
        something: function(file, config, info, bundleDirs, bundlerActions){
            console.log('DO SOMETHING');
            console.log();
        }
    };

bundler.bundle('bundle.json', actions, 'debug');

Commandline Usage Examples

Using configuration file:

$ bundle path/to/configuration.json

and specifying mode:

$ bundle path/to/configuration.json mode

Commandline options:

  • 0 path/to/configuration.json - path to configuration JSON file.
  • 1 mode - mode identifier.

Configuration File Example

{
  "verbose": true,
  "source": "src",
  "intermediate": {
    "debug": "intermediate/debug",
    "release": "intermediate/release"
  },
  "destination": {
    "debug": "bin/debug",
    "release": "bin/release"
  },
  "compiler": {
    "debug": {
      "lint": true,
      "minify": false,
      "defines": {
        "DEBUG": true
      }
    },
    "release": {
      "lint": true,
      "minify": true,
      "defines": {
        "RELEASE": true
      }
    }
  },
  "files": [
    "a.png : gfx/a.png @listAsset ? gfx & hq",
    "b.png : gfx/b.png @listAsset ? gfx & !hq",
    "main.js : app.js @compile|something ? (code & html)",
    "assets.json @flushAssetsList"
  ],
  "variants": {
    "debug": [
      "html",
      "code",
      "gfx"
    ],
    "release": [
      "html",
      "code",
      "gfx",
      "hq"
    ]
  }
}

Support

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago