Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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('jasmine');   gulp.run('embed');  };  var client = function(){   gulp.run('scripts');   gulp.run('styles');   gulp.run('copy');   gulp.run('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', function(){   gulp.run('copygeojson');  }); }); 

The corresponding changelog https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md#35 [deprecate gulp.run]

like image 468
toutpt Avatar asked Feb 20 '14 11:02

toutpt


People also ask

How do you write a gulp task?

If you just want a task that runs some function, then just do that: gulp. task('my-custom-task', function () { myCustomFunction('foo', 'bar'); });

What is Gulp watch command?

Advertisements. The Watch method is used to monitor your source files. When any changes to the source file is made, the watch will run an appropriate task. You can use the 'default' task to watch for changes to HTML, CSS, and JavaScript files.


1 Answers

Or you can do like this:

gulp.start('task1', 'task2'); 
like image 173
Pavel Evstigneev Avatar answered Sep 24 '22 07:09

Pavel Evstigneev