0.5.2 • Published 11 years ago

auton v0.5.2

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

Auton - automated resource compiler

(for a quick start, see example/example.js. The code below is a simple example of how to define your own rules / chains)

this is very rudimentary and i'd like a more complicated example in here.

var auton    = require('./lib/auton'),
    Compiler = auton.Compiler,
    plugins  = auton.plugins,
    path     = require('path');

var compiler = new Compiler('build', 'htdocs', true); // true is whether or not watch mode is on

compiler.addRule(
  /.js$/,
  javascriptSave,
  [plugins.read, plugins.jshint, plugins.uglify, plugins.gzip, plugins.save]
);

compiler.start();


// decide what the filename of saved files should be
function javascriptSave(type, filePath) {
  var filename = path.basename(filePath, '.js'),
      dirname  = path.dirname(filePath),
      output   = dirname + "/" + filename;

  if (type === 'minified') {
    return output + ".min.js";
  }
  else if (type === 'compressed') {
    return output + ".min.js.gz";
  }
  else if (type === 'plain' || type === '__age_check__') {
    return output + ".js";
  }
  else {
    return null;
  }
}

this example will find all files ending with .js within the folder 'build', run them through jshint, uglify-js, and gzip, and save a non-minified, a minified, and a minified+gzipped version.

0.5.2

11 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.1.15

11 years ago

0.1.14

11 years ago

0.1.13

11 years ago

0.1.12

11 years ago

0.1.11

12 years ago

0.1.10

12 years ago

0.1.9

12 years ago

0.1.8

13 years ago

0.1.7

13 years ago

0.1.6

13 years ago

0.1.5

13 years ago