[英]Gulp create zip after all other tasks
我有一個帶有一些不同任務的gulp文件。 當我想進行生產構建時,運行gulp.task('build', ['styles', 'uglify', 'copyScripts', 'copyImgs', 'copyFonts', 'compress']);
。 我遇到的問題是我需要所有其他任務完成后才能運行任務compress
。
您可以嘗試以下方法:
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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.