-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
36 lines (25 loc) · 826 Bytes
/
gulpfile.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
35
36
const gulp = require('gulp');
const spawn = require('child_process').spawn;
//= ================================== Global Variable ===================================
//= ================================== Method ===================================
const cmd = (str) => async (cb) => {
const arr = str.split(' ');
const c0 = arr.shift();
console.log('exec => ', str);
await new Promise((resolve, reject) => {
const ssp = spawn(c0, arr, { stdio: 'inherit' });
ssp.on('close', (code) => {
resolve(code);
});
ssp.on('error', function (err) {
reject(err);
});
});
cb();
};
//= ================================== Tasks ===================================
exports.build = gulp.parallel(
cmd('mocha'),
cmd('tsc -p ./tsconfig.json'),
cmd('tsc -p ./tsconfig.esm5.json'),
);