onedarnleyroad / generator-one-craft

Yeoman generator to scaffold a new Craft CMS project
0 stars 0 forks source link

Add Clean task for built assets #11

Open nathanchicken opened 8 years ago

nathanchicken commented 8 years ago

As an example, here is what is working on GT:

gulp.task('clean', function() {
    console.log("Cleaning!")
    return gulp.src(
        [
            publicAssets + '/css',
            publicAssets + '/vendor',
            publicAssets + '/js',
            publicAssets + '/img'

        ], { read: false }) // much faster
     .pipe($.plumber())
    //.pipe(ignore('protected/**'))
    .pipe($.rimraf());

});

gulp.task('build', ['clean'], function() {
    gulp.start('default');
});

gulp.task('default', ['styles', 'vendor', 'scripts', 'images'], function() {
    console.log( "Built Everything");
});
nathanchicken commented 8 years ago

This is important as during development you end up adding and removing images, vendor scripts etc as you change your mind so we need a way to stop junk piling up.