You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a clean mechanism to 'bust-in-place', i.e. Rename the source files if they are busted. The task I've created to do this is a bit hacky/ugly.
Tips, or suggestions welcome.
gulp.task('revAllAndReplace', function(done) {
var revAll = new RevAll();
var stream = gulp.src('dist/**')
.pipe(revAll.revision())
.pipe(gulp.dest('dist')) // Instead something like: .pipe(revAll.replace())
.pipe(revAll.manifestFile())
.pipe(gulp.dest('dist'));
stream.on('end', function() {
var manifest = require('./dist/rev-manifest.json');
var arr = [];
for(var origFileName in manifest) {
if(origFileName != manifest[origFileName]) { // For all files busted/renamed
arr.push('./dist/' + origFileName); // Add the original filename to the list
console.log(origFileName);
}
}
// Using npm 'del' package in this case to remove original files
del(arr, done); // Delete all originals files the were not busted/renamed
});
stream.on('error', done);
});
The text was updated successfully, but these errors were encountered:
Is there a clean mechanism to 'bust-in-place', i.e. Rename the source files if they are busted. The task I've created to do this is a bit hacky/ugly.
Tips, or suggestions welcome.
The text was updated successfully, but these errors were encountered: