最近在用gulp构建前端代码,遇到一个问题 gulp.task('imagemin’, function () { gulp.src('./static/*/img/') .pipe(imagemin({ progressive: true })) .pipe(gulp.dest(‘./dist/image’)) .pipe(notify({ message: ‘Images task complete’ })); }); 这样我每压缩一张图片就会给出一个提示,我想让图片全部压缩完成之后给一个通知就行 请问应该如何做到?
4 回复
https://github.com/mikaelbr/gulp-notify 看文档呀
options.onLast
Type: Boolean Default: false
If the notification should only happen on the last file of the stream. Per default a notification is triggered on each file.