Skip to content

Commit

Permalink
add gulp images and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
pMedeiros authored and pMedeiros committed Aug 24, 2015
1 parent ba2860b commit 8c82b84
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1,563 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ obj
node_modules
bower_components
build
#.tmp
tmp

# Ignore Test reporters
###################
Expand Down
2 changes: 2 additions & 0 deletions gulp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module.exports = function () {

fonts: './bower_components/font-awesome/fonts/**/*.*',

images: client + 'images/**/*.*',

less: client + 'styles/styles.less',

allless: '**/*.less',
Expand Down
27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,37 @@ gulp.task('fonts', ['clean-fonts'], function () {

gulp.task('clean-fonts', function (cb) {
log('Cleaing fonts folder');

var files = [config.build + 'fonts/'];
clean(files, cb);
});

gulp.task('images', ['clean-images'], function () {
log('Copying and compressing images');

return gulp
.src(config.images)
.pipe($.plumber())
.pipe($.imagemin({
optimizationLevel: 4
}))
.pipe(gulp.dest(config.build + 'images'));
});

gulp.task('clean-images', function (cb) {
log('Cleaing images folder');

var files = [config.build + 'images/'];
clean(files, cb);
});

gulp.task('clean', function (cb) {
log('Cleaing build and tmp folders');

var files = [].concat(config.build, config.tmp);
clean(files, cb);
});

/*
* Generic methods
*/
Expand Down
Loading

0 comments on commit 8c82b84

Please sign in to comment.