There are two tasks: build:scss and build:js :
gulp.task('build:scss', function () { return gulp.src(paths.src.scss) .pipe(scss({ includePaths: includePaths.scss })) .pipe(rev()) .pipe(gulp.dest('public/build')) .pipe(rev.manifest({ path: 'public/build/rev-manifest.json', merge: true })) .pipe(gulp.dest('')); }); gulp.task('build:js', function () { return gulp.src(paths.src.js) .pipe(rigger()) .pipe(rename('app.min.js')) .pipe(rev()) .pipe(gulp.dest('public/build')) .pipe(rev.manifest({ path: 'public/build/rev-manifest.json', merge: true })) .pipe(gulp.dest('')) }); There is also a sketch:
gulp.task('watch', function () { watch([paths.watch.scss], function () { gulp.start('build:scss'); }); watch([paths.watch.js], function () { gulp.start('build:js'); }); }); The task : creating revisions of css and js files and writing their names in rev-manifest.json (all this in the watch calls of the players)
Current result : everything works, but if you change scss and js and save, then one of them is not written in the rev-manifest (in my case, css)
As I understand it, the question here is to synchronize write access to the rev-manifest file. Tell me, please, which way to dig?
Also, in order not to create a new question, tell me what to do with the old revision files? Now its own function has been written, but ... Surely there is a correct approach - I would like to know.
PS added gulp-sync to build task - it works fine, but it does not solve problems with watchdogs. And to run the build and js and scss when you change one of the files - probably not a very good solution. PPS I also tried to play with gulp-queue , however, as I understood, this is not exactly that.