Created
July 8, 2017 17:40
-
-
Save AkshayRana92/c47ca6e19ce23719220cd9d6d5ab7d50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plumber = require('gulp-plumber'); //Add dependency to package.json if not added | |
var imagemin = require('gulp-imagemin'); //Add dependency to package.json if not added | |
gulp.task('minify-images', function () { | |
return gulp.src(['assets/images/**/*.*']) | |
.pipe(plumber({ | |
errorHandler: function (err) { | |
console.log(err); | |
this.emit('end'); | |
} | |
})) | |
.pipe(imagemin({ | |
progressive: true | |
})) | |
.pipe(gulp.dest('dist/prod/src/assets/images/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment