Created
August 23, 2015 17:24
-
-
Save ahmadawais/3d7dc71cd762508be58a to your computer and use it in GitHub Desktop.
Gulp: Images minificaiton task
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
/** | |
* Images | |
* | |
* Look at src/images, optimize the images and send them to the appropriate place | |
*/ | |
gulp.task('images', function() { | |
// Add the newer pipe to pass through newer images only | |
return gulp.src(['./assets/img/raw/**/*.{png,jpg,gif}']) | |
.pipe(newer('./assets/img/')) | |
.pipe(rimraf({ force: true })) | |
.pipe(imagemin({ optimizationLevel: 7, progressive: true, interlaced: true })) | |
.pipe(gulp.dest('./assets/img/')) | |
.pipe( notify( { message: 'Images task complete', onLast: true } ) ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment