File: build/dev.js

Recommend this page to a friend!
  Classes of Emil Kilhage  >  class.js  >  build/dev.js  >  Download  
File: build/dev.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: class.js
Create classes with Node.js, jQuery and JavaScript
Author: By
Last change: Update of build/dev.js
Date: 5 months ago
Size: 528 bytes
 

Contents

Class file image Download
/*jslint node: true, strict: false */
var u = require("./utils.js"),
    b = require("./build.js"),
    fs = require("fs"), 
    size,
    type = process.argv[2] || "js";

if (!b.types.hasOwnProperty(type)) {
    throw "invalid type: " + type;
}

var file = type + ".class.js";

console.log("watching: " + file + "...\n");

fs.watchFile(u.path("src/class.js"), function (curr) {
    if (!curr.size || size === curr.size) {
        return;
    }
    b.build(type);
    console.log(file + " updated..");
    size = curr.size;
});