1 |
|
2 |
|
3 | /**
|
4 | * Watch files.
|
5 | */
|
6 |
|
7 |
|
8 |
|
9 | process.chdir(`${__dirname}/..`)
|
10 |
|
11 | const apeWatching = require('ape-watching')
|
12 | const childProcess = require('child_process')
|
13 |
|
14 | let timer = null
|
15 |
|
16 | apeWatching.watchFiles([
|
17 | 'lib/**/*.jsx'
|
18 | ], (ev, filename) => {
|
19 | clearTimeout(timer)
|
20 | timer = setTimeout(function () {
|
21 | childProcess.fork('ci/compile.js')
|
22 | }, 300)
|
23 | })
|