I have been utilizing Gulp v.4 from npm along with the gulp-rev and gulp-rev-rewrite plugins to prevent Cache Busting of CSS and JS files. However, despite going through numerous guides and notes, I am encountering an issue where the links inside my HTML (specifically in a latte file) are not being rewritten as expected. The gulp-rev plugin seems to be functioning correctly, but the rewriting of links is not happening.
gulp.task('rev', () =>
gulp.src('web/dist/**/*.{css,js}')
.pipe(rev())
.pipe(gulp.dest('web/dist/build'))
.pipe(rev.manifest())
.pipe(gulp.dest('web/dist'))
);
function rew() {
const manifest = gulp.src('web/dist/rev-manifest.json');
return gulp.src('app/FrontModule/templates/_styles.latte')
.pipe(revRewrite({ manifest: manifest }))
.pipe(gulp.dest('test'));
}
The contents of rev-manifest.json are as follows:
{
"bootstrap-t4s.min.css": "bootstrap-t4s-85b8c0fa84.min.css",
}
In the HTML (latte) file _styles.latte, I have the following link:
<link rel="stylesheet" href="css/bootstrap-t4s.min.css" media="all">
Upon running the gulp function to rewrite the file using the JSON manifest, the _styles.latte file remains unchanged:
<link rel="stylesheet" href="css/bootstrap-t4s.min.css" media="all">
I'm unsure of what I might be doing incorrectly. Any insights?