()
| 57 | let mainTaskProcess; // 记录当前 gulp 运行时的进程 |
| 58 | |
| 59 | const restart = () => { |
| 60 | if (mainTaskProcess) { |
| 61 | mainTaskProcess.kill(); |
| 62 | } |
| 63 | |
| 64 | const mainTask = ['main']; |
| 65 | if (typeof argv.color !== 'undefined' && !argv.color) { |
| 66 | mainTask.push('--no-color'); |
| 67 | } |
| 68 | mainTaskProcess = spawn('gulp', mainTask, {stdio: 'inherit'}); |
| 69 | }; |
| 70 | |
| 71 | gulp.watch('package.json').on('all', () => { |
| 72 | mix.util.log(''); |