Convert gulp watch in gulp@3.9.1 to gulp@4

前端 未结 3 1951
一向
一向 2021-01-03 15:41

We are switching from gulp@3.9.1 to gulp@4 and are having trouble switching over. When we run gulp watch, we are getting the following

3条回答
  •  没有蜡笔的小新
    2021-01-03 16:37

    I just ran into this a couple days ago myself. What worked for me was to run each task in its own gulp.watch() with the gulp.series() on the watch task call instead of the watch task itself. For example:

    gulp.task('watch', function() {
      gulp.watch(src.js, gulp.series('minify-js'));
      gulp.watch(src.css, gulp.series('minify-css'));
    });
    

提交回复
热议问题