Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Improving your Gulp Task Pipelines Putting Multiple Tasks Together

Ryan Doran
Ryan Doran
7,815 Points

gulp.series() & gulp.parallel()

for Gulp 4 users (anyone that has recently downloaded gulp):

Gulp.series() with a list of task dependencies as arguments will perform the tasks based upon the order you have them within the parenthesis. Gulp.parallel() produces an async task, indiscriminate of the order.

i.e.

gulp.task('default', gulp.series('a', 'b', 'c'));

In this case, tasks a, b, and c will run in sequential order.

however with

gulp.task('default', gulp.parallel('a', 'b', 'c'));

the tasks will run task a, b, and c at the same time.

Gulp 4 makes life easier, and no need to add 'return' to your gulp tasks in the gulpfile.js file.