-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.ts
41 lines (31 loc) · 910 Bytes
/
gulpfile.ts
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
37
38
39
40
41
import { series, task } from 'gulp'
import { argv } from 'yargs'
import cmd from 'gulp-run-command'
function run(command: string) {
return cmd(command)()
}
export async function clean() {
return run('rm -rf build/')
}
export async function transpile() {
return run('tsc')
}
export async function lint() {
return run('eslint .')
}
export const build = series(clean, transpile)
testAll.description = 'Runs all the apps tests'
export async function testAll() {
return run('mocha ./build/test/')
}
launch.description = 'Runs the app'
export async function launch() {
return run('node build/main.js')
}
debug.description = `Debug app on default port 6969. Change by passing --port=<number>`
export async function debug() {
const port = argv.port || 6969
return run(`node --inspect-brk=${port} build/main.js`)
}
task('build-test', series(build, testAll))
export default series(build, lint, launch)