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
So, basically all paths that need to be replaced are followed by ", ' or ). We make sure the plugin replaces only matches that are followed by one of those characters.
gulpfile.js
constmodifyOnlyThoseEndingWith=(ending)=>{return(filename)=>{// Other modifications specific to your buildfilename+=ending;returnfilename;};};gulp.task('revision-replace',()=>{// We need a stream to consume for each `gulp-rev-replace` callconstmanifest1=gulp.src('path/to/rev-manifest.json');constmanifest2=gulp.src('path/to/rev-manifest.json');constmanifest3=gulp.src('path/to/rev-manifest.json');returngulp.src('build-dir/**').pipe($.revReplace({manifest: manifest1,modifyUnreved: modifyOnlyThoseEndingWith('\''),modifyReved: modifyOnlyThoseEndingWith('\''),})).pipe($.revReplace({manifest: manifest2,modifyUnreved: modifyOnlyThoseEndingWith('"'),modifyReved: modifyOnlyThoseEndingWith('"'),}))// Used for CSS url() notation.pipe($.revReplace({manifest: manifest3,modifyUnreved: modifyOnlyThoseEndingWith(')'),modifyReved: modifyOnlyThoseEndingWith(')'),})).pipe(gulp.dest('build-dir'));});
Getting a false positive in a bundled js file for an external library that contains
style.css
is replaced with the rev'd string from the manifest, invalidating the bundle.The text was updated successfully, but these errors were encountered: