Closed michalskyPL closed 8 years ago
https://github.com/sindresorhus/gulp-rev#asset-hash. Try the following:
var modifyFilename = require('modify-filename');
var through = require('through2');
.pipe(rev())
.pipe(through.obj(function (file, enc, cb) {
file.path = modifyFilename(file.revOrigPath, function (name, ext) {
return [new Date().toString(), file.revHash, name + ext].join('_');
});
cb(null, file);
})
.pipe(gulp.dest('deploy/'));
Hi, my gulp-rev add revs to zipped app/page template.
my workflow app -> zip -> revision, and i want to add a timestamp to rev hash like this : date_hash_filename.ext
my gulpfile.js
var rev = require('gulp-rev'); var date = new Date(dateString); gulp.task('rev', function () { return gulp.src('app/*.zip') .pipe(rev()) .pipe(gulp.dest('deploy/')); });
Should i add new Date().toString()) to rev() or edit the index.js in rev-hash or rev-path ?