Grady D
Grady D

Reputation: 2019

Gulp create zip after all other tasks

I have a gulp file with a few different tasks. When I want to make a production build I run, gulp.task('build', ['styles', 'uglify', 'copyScripts', 'copyImgs', 'copyFonts', 'compress']);. The problem I am having is that I need the task compress to run after all others are finished.

Upvotes: 0

Views: 84

Answers (1)

MarcoL
MarcoL

Reputation: 9989

You can try the following:

function compressFn(){
  // write the code to compress here
}

// For backward compatibility with other tasks
gulp.task('compress', compressFn);

// It performs first all the tasks in the array THEN it calls compressFn
gulp.task('build', ['styles', 'uglify', 'copyScripts', 'copyImgs', 'copyFonts'], compressFn);

Upvotes: 1

Related Questions