Gulp tasks remove content from assets/ directory


I have this problem that when I drop my video assets in the assets/ directory into videos/ folder, they get removed by one of the gulp tasks when running gulp or gulp --production.

It appears that in the current setup only fonts, images, scripts and styles are expected to live in the assets directory.

How can I make Gulp NOT remove additional assets that I might drop into this folder?


It’s the gulp clean task that is removing your additional folders when processing and then moving to /dist/. See here:

I’d recommend making a new “videos” task and just having that copy over each of the files, but there’s probably a few ways to skin that cat.

1 Like

This is exactly what I did, thanks

Any chance you’d be willing to share that task? I’m trying to do the exact same thing.


I’ve taken a very simple approach:

Added a ‘videos’ task that just copies files:

 gulp.task('videos', function() {
     return gulp.src(path.source + 'video/*')
         .pipe(gulp.dest(path.dist + 'video'))

next,included the task in the build process:

gulp.task('build', function(callback) {
              ['fonts', 'images'],