In the gulpfile.js file, I used the require-dir plugin, which directs the collector to another folder containing tasks, divided into separate files. There is a task associated with deleting files, using the plugin plugin del . As planned, I would like the first one to build each assembly, it would demolish the files of the previous build. He removes them, but conflicts arise. Build starts:

By picture It is clear that the delete task starts, everything goes on until an error occurs:

Error: ENOTEMPTY: directory not empty, rmdir '/home/projectpath/build' 

Taska code:

 var gulp = require('gulp'); var del = require('del'); gulp.task('delete', function () { return del('./build/**', {force:true}); }); 

Code build task:

 var gulp = require('gulp'); gulp.task('build', ['browserify', 'markup', 'dashboard-markup', 'frontend-style', 'dashboard-style', 'frontend-images', 'frontend-fonts']); 

Taska code default:

 var gulp = require('gulp'), config = require('../config'), gutil = require('gulp-util'); gulp.task('default', ['delete','browserSync'], function() { return gutil.log('Tasks completed!') }); 

I suppose that the whole thing is that the deletion does not have time to complete and he begins to perform other tasks because of what a conflict arises. Can if you set some condition, can you slow down other tasks until it all deletes?

  • one
    I found an intermediate solution in each task of the gulpa added ['delete'], now while it is not executed, others do not start.

0