What worked for me was using gulp-rename
and then doing something like:
.pipe($.rename({
dirname: 'styles',
}))
.pipe($.rev.manifest('manifest.json', {
cwd: 'build',
merge: true,
}))
However, what ultimately worked for me was using gulp-rev
in combination with gulp-rev-collector
, the latter which replaces the links as per the mappings found in the manifest files.
So something like:
.pipe($.rename({
dirname: 'styles',
}))
.pipe($.rev())
.pipe(gulp.dest('build'))
.pipe(gulp.dest('.tmp/styles'))
.pipe($.rev.manifest())
.pipe(gulp.dest('build/styles'));
And also adding a new rev
task for gulp-rev-collector
// Revision static asset files
gulp.task('rev', () =>
gulp.src(['build/**/rev-manifest.json', 'build/*.html'])
.pipe($.revCollector())
.pipe(gulp.dest('build')),
);