Skip to content

Instantly share code, notes, and snippets.

@tolgaek
Created August 19, 2015 22:31
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 tolgaek/904398d4c7ef37dcbdad to your computer and use it in GitHub Desktop.
Save tolgaek/904398d4c7ef37dcbdad to your computer and use it in GitHub Desktop.
Gulpfile created for Thinkful Gulp Workshop
var gulp = require('gulp');
var changed = require('gulp-changed');
var imagemin = require('gulp-imagemin');
var del = require('del');
gulp.task('minimizeImages', function() {
return gulp.src('img/*.gif')
.pipe(changed('build'))
.pipe(imagemin())
.pipe(gulp.dest('build'));
});
gulp.task('clean', function(callback) {
del('*/img', callback);
});
gulp.task('watch', function() {
gulp.watch('./**/*.gif', ['minimizeImages']);
});
gulp.task('build', ['minimizeImages']);
gulp.task('default', ['build']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment