From e887517f8285680edd2ab0879aeb38869e99b990 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 8 Jun 2014 15:58:53 -0700 Subject: [PATCH] add clean task that uses the rimraf module and not streams --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d676032fb..42c1efba7 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,20 @@ var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var imagemin = require('gulp-imagemin'); +var rimraf = require('rimraf'); + var paths = { scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'], images: 'client/img/**/*' }; -gulp.task('scripts', function() { +// Not all tasks need to use streams +// Gulp is just another node program and you can use all packages available on npm +gulp.task('clean', function(cb){ + rimraf('build/', cb); +}); + +gulp.task('scripts', ['clean'], function() { // Minify and copy all JavaScript (except vendor scripts) return gulp.src(paths.scripts) .pipe(coffee()) @@ -42,7 +50,7 @@ gulp.task('scripts', function() { }); // Copy all static images -gulp.task('images', function() { +gulp.task('images', ['clean'], function() { return gulp.src(paths.images) // Pass in options to the task .pipe(imagemin({optimizationLevel: 5}))