-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.js
17 lines (13 loc) · 882 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"use strict";
const spawn = require("child_process").spawn;
const spawnOptions = { stdio: "inherit" };
const suffix = (process.platform === "win32") ? ".cmd" : "";
const watchMode = process.argv[2] === "-w";
const bundler = watchMode ? "watchify" : "browserify";
const watchArgs = watchMode ? [ "-w" ] : [];
spawn(`jade${suffix}`, watchArgs.concat([ `${__dirname}/src/index.jade`, "--out", `${__dirname}/lib` ]), spawnOptions);
spawn(`stylus${suffix}`, watchArgs.concat([ `${__dirname}/src/index.styl`, "--out", `${__dirname}/lib` ]), spawnOptions);
spawn(`tsc${suffix}`, [ "-p", `${__dirname}/src` ], spawnOptions).on("close", () => {
if (watchMode) spawn(`tsc${suffix}`, watchArgs.concat([ "-p", `${__dirname}/src` ]), spawnOptions);
spawn(`${bundler}${suffix}`, [ `${__dirname}/src/index.js`, "-s", "TabStrip", "-o", `${__dirname}/lib/TabStrip.js` ], spawnOptions);
});