-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.js
31 lines (25 loc) · 940 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var fs = require('fs')
var path = require("path")
var buildModule = require("build-modules")
var buildDirectory = path.join(__dirname,'dist')
if(!fs.existsSync(buildDirectory)) {
fs.mkdirSync(buildDirectory)
}
var copywrite = '/* Copyright (c) 2013 Billy Tetrud - Free to use for any purpose: MIT License*/'
console.log('building and minifying...')
build('odiff', false, {output: {path:buildDirectory}, header: copywrite})
function build(relativeModulePath, watch, options) {
var emitter = buildModule(path.join(__dirname, '..', relativeModulePath), {
watch: watch/*, header: copyright*/, name: options.name, minify: true,
output: options.output
})
emitter.on('done', function() {
console.log((new Date())+" - Done building "+relativeModulePath+"!")
})
emitter.on('error', function(e) {
console.log(e)
})
emitter.on('warning', function(w) {
console.log(w)
})
}