On the gulp page there is the following example:
gulp.task(\'clean\', function(cb) {
// You can use multiple globbing patterns as you would with `gulp.src`
Use del.sync. It completes the del and then returns from the task
gulp.task('clean', function () {
return $.del.sync([path.join(conf.paths.dist, '/**/*')]);
});
and be sure clean is the first task in a list of tasks. For example,
gulp.task('build', ['clean', 'inject', 'partials'], function () {
//....
}
@Ben i liked the way you have separated clean:css clean:js tasks. That's a great tip