gulp是前端构建神器如果你想了解的话请看这篇文章前端构建利器-gulp
- 但是在mac版如果有图片压缩就会报错

- 2.解决办法- 添加这段代码就可以了

/*压缩图片*/
gulp.task('image',function () {
gulp.src(app.srcPath+'images/**/*')
.pipe(gulp.dest(app.buildPath+'images'))
.pipe(imagemin())
// 在图片压缩之后添加这行代码就可以运行起来了
.on('error', function(err) {
this.end();
})
.pipe(gulp.dest(app.distPath+'images'))
.pipe(connect.reload())
});
持续更新使用的干货
微信公众号coderYJ
微博coderYJ
简书coderYJ
网友评论