I'm having problems with my gulp-rev-all
task. Everytime I change the code, it will generate a new revision file, but leave the old one there.
Here is my gulp task:
var gulp = require('gulp');
var RevAll = require('gulp-rev-all');
gulp.task('js', function() {
var revAll = new RevAll();
return gulp.src(opt.Src + 'scripts.js')
// Add a hash to the file
.pipe(revAll.revision())
// Save the hashed css file
.pipe(gulp.dest(path.js))
// Write the manifest file
.pipe(revAll.manifestFile())
.pipe(gulp.dest(path.js + 'rev'));
});
So, this works like a charm.
It will give me a file with a rev (like: scripts.0ad8ecf1.js
) and a manifest.json
file.
The challange is, whenever I change my code, it will generate a new scripts.js
file with a different hash and not overwrite or remove the old one. So, my folder looks like this now:
scripts.0ad8ecf1.js
scripts.7e3fa506.js
scripts.056ddda0.js
I can't seem to replace the old file for the new one. Can anybody help me or point me in the right direction to accomplish this?