panthro
panthro

Reputation: 24059

If statement in series of tasks?

I have checked out gulpif and various other posts, but they only state how to do this inside a task.

I want to be able to have an if statement to decide which task in a series to run, something like:

gulp.task('build',
gulp.series(task1, task2, task3, if(true){task 4} else {task5}));

Upvotes: 1

Views: 813

Answers (1)

gauss
gauss

Reputation: 177

This should work:

gulp.series(task1, task2, task3, condition ? task4 : task5);

Upvotes: 2

Related Questions