Skip to content

Instantly share code, notes, and snippets.

@AkshayRana92
Created July 8, 2017 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayRana92/c47ca6e19ce23719220cd9d6d5ab7d50 to your computer and use it in GitHub Desktop.
Save AkshayRana92/c47ca6e19ce23719220cd9d6d5ab7d50 to your computer and use it in GitHub Desktop.
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