1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gulpのrun-sequenceで並列と直列を織り交ぜたい

Posted at

どこにも載ってないような気がしたので。

織り交ぜたいとは

  • こんな感じ

image

  • run-sequenceだと、task2-1と2-2のあたりがうまく書けない(と思う)

やりかた

  • 直列にしたい処理をラップしたタスク(task2)を新たに作る。
  • 内部ではrunSequenceを使って直列に処理させる。
gulp.task( "task1", function( done ) {
  // なんか処理
  done();
} );

gulp.task( "task2-1", function( done ) {
  // なんか処理
  done();
} );

gulp.task( "task2-2", function( done ) {
  // なんか処理
  done();
} );

gulp.task( "task3", function( done ) {
  // なんか処理
  done();
} );

gulp.task( "task4", function( done ) {
  // なんか処理
  done();
} );

gulp.task( "task2", function( done ) {
  return runSequence( "task2-1", "task2-2", done );
} );

gulp.task( "run", function( done ) {
  runSequence( "task1", [ "task2", "task3" ], "task4" );
} );
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?