Skip to content

Instantly share code, notes, and snippets.

@patrickheeney
Created January 22, 2014 00:30
Show Gist options
  • Save patrickheeney/8551352 to your computer and use it in GitHub Desktop.
Save patrickheeney/8551352 to your computer and use it in GitHub Desktop.
//
// Command: optimize
//
gulp.task('optimize', ['imagemin']);
//
// Command: watch
//
gulp.task('watch', function () {
gulp.watch('gulpfile.js', ['gulpfile']);
gulp.watch('assets/scss/{,**/}*.scss', ['compass:dev', 'concat:css']);
gulp.watch('assets/javascript/{,**/}*.js', ['concat:js']);
});
gulp.task('imagemin', function() {
return gulp.src('assets/images/**')
.pipe(imagemin({optimizationLevel: 5}))
.pipe(gulp.dest('assets/images'));
});
// Outputs
[gulp] Finished 'imagemin' in 901 ms
[gulp] Running 'optimize'...
[gulp] Finished 'optimize' in 7.91 μs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment