Answer the question
In order to leave comments, you need to log in
How to generate normal rev-manifest with Gulp?
Good time.
By the will of evil fate, I deal with building a project using gulp, in which gulp-rev is used for the revision manifest (a file with a hash of the file version, to automatically reset the static cache) . Based on the examples provided by the API and capabilities, we can conclude that this plugin produces copies of static files, supplementing them with a hash right in the name, then it writes all this to a json file. For example, there was styles.css - it became styles-209fkjshkfj89.css...
This is at least ugly.
Grunt used the wonderful grunt-version plugin , which only writes hashes to manifest.json without changing the css \ js files themselves.
This is beautiful and comfortable.
Actually, the question is - is it possible to force gulp to generate a manifest without touching the static itself, so that everything is human? .. I have not yet found an alternative to gulp-rev.
I would really appreciate any advice/links to plugins, thanks.
Answer the question
In order to leave comments, you need to log in
Nevertheless, I found an adequate solution for an inadequate collector. Using a fork of gulp-rev-all , you can get the desired file with a hash without dancing with tambourines around the static.
var RevAll = require('gulp-rev-all');
gulp.task('manifest', function () {
var revAll = new RevAll();
return gulp.src(['assets/styles/**'])
.pipe(revAll.revision())
.pipe(revAll.versionFile())
.pipe(gulp.dest('dist'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question