gulp.run is deprecated. How do I compose tasks?

后端 未结 10 1204
感情败类
感情败类 2020-12-22 18:57

Here is a composed task I don\'t know how to replace it with task dependencies.

...
gulp.task(\'watch\', function () {
 var server = function(){
  gulp.run(\         


        
10条回答
  •  囚心锁ツ
    2020-12-22 19:33

    gulp.task('watch', function () {
      var server = ['jasmine', 'embed'];
      var client = ['scripts', 'styles', 'copy', 'lint'];
      gulp.watch('app/*.js', server);
      gulp.watch('spec/nodejs/*.js', server);
      gulp.watch('app/backend/*.js', server);
      gulp.watch('src/admin/*.js', client);
      gulp.watch('src/admin/*.css', client);
      gulp.watch('src/geojson-index.json', ['copygeojson']);
    });
    

    You no longer need to pass a function (though you still can) to run tasks. You can give watch an array of task names and it will do this for you.

提交回复
热议问题