跳到主要内容
CNode

新人求教关于gulp的问题

社区
Bbigbig-orange发布于 12 年前最后回复 12 年前
442450

最近在用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)

B
bigbig-orange#412 年前
引用 ringtail.pipe(notify({ message: 'Images task complete' }));这个造成的。

嗯,知道是这一句,楼上是答案了,也谢谢你

B
bigbig-orange#312 年前
引用 fundonhttps://github.com/mikaelbr/gulp notify 看文档呀

谢谢,成功了我以为是通过gulp的api控制呢给notify自身的忽略了

R
ringtail#212 年前

.pipe(notify({ message: 'Images task complete' }));这个造成的。

F
fundon#112 年前

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.

参与回复

登录后即可参与回复。登录