-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
35 lines (31 loc) · 932 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
32
33
34
#!/usr/bin/env node
"use strict";
const commander = require("commander");
const stealTools = require('steal-tools');
commander.version("0.0.1")
.usage("[options]")
.description("transpile ting/done-serve")
.option("-d, --development", "Enable development-mode (no-minify)")
.option("-p, --production", "Enable production-mode (minify)")
.parse(process.argv)
;
const isProduction = (commander.production) ? true : false;
console.log("build - [isProduction]=>[" + isProduction + "]");
const buildPromise = stealTools.build({
config: __dirname + '/package.json!npm'
}, {
// if not production, than build without minifying for debugging "live" only issues
minify: (isProduction),
bundleAssets: true
}).then(
// done
function(buildResult) {
//console.log({"buildPromise.done.buildResult": buildResult});
},
// fail
function(buildResult) {
console.log(buildResult);
// exit 'failure'-code
process.exit(1);
}
);