gulp watch doesn't watch

前端 未结 1 988
自闭症患者
自闭症患者 2020-12-20 07:51

Following is my gulpfile.js. There are a couple of more tasks in it and all are working fine - but the last task, watch doesn\'t.

I\'ve tried every pos

相关标签:
1条回答
  • 2020-12-20 08:35

    You should return watch:

    gulp.task('watch', function() {
        return gulp.watch('./public/resources/jsx/project/*.js',['application'])
    });
    

    watch is an async method, so the only way Gulp can know that something is happening is if you return a promise, which watch does.

    Edit

    As @JMM stated, watch doesn't return a Promise. It returns an EventEmitter.

    0 讨论(0)
提交回复
热议问题