Asset management for Node.js
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Node.js asset compiler that supports JavaScript, Handlebars, CSS and LESS.

##What It Does Velociraptor will compile assets in a source directory and dump them into an output directory.

  1. Velociraptor will first build the bundles defined in source/bundles.json
  2. Any files in source that were not part of a bundle will be copied to output
  3. Important: .less files will not be copied as part of this step as they are expected to be part of a bundle.

##bundles.json example

      "dir": "templates",
      "type": "handlebars"

###Handlebars To precompile, put your templates in a directory and Velociraptor will recursively discover your templates. Note the special syntax in bundles.json -- you must define a directory, not the individual files.

##Command-line Usage

# Compile from ./assets to ./tmp
# without minification
velociraptor ./assets ./tmp

# Compiling: /somepath/assets
#      into: /somepath/tmp
#            without minification
# Compiled 2 bundles from 7 sources
# Copied 4

# Compiling with minification
velociraptor -m ./assets ./tmp

##Programmatic Usage

var Velociraptor = require('velociraptor');

//No minification
Velociraptor.compile(source, target, function(err, results) {
  if(err) {
    console.log("Error: "+err);
  else {
    // e.g.
    // {
    //    bundles: 2
    //  , bundlesources: 7
    //  , minified: false
    //  , copied: 5
    // }

Velociraptor.compile(source, target, {minify:true}, function(err, results) {