-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.woff2 references inside css not renaming correctly #83
Comments
I tried to reproduce your issue, but woff2 files are being correctly rev'd in my case. Are you using |
Hi @TheDancingCode, sorry for the terribly late replay - still not having any luck here. The manifest.json appears correct, so somewhere in the renaming task it's going bad. Do you have both .woff and .woff2 files referenced in your css and are you appending to the file extension during the rename like my example? I suspect the regex or whatever is being used to rename the extensions is getting confused between the two strings. |
Could you share the rev-manifest entries for the .woff and .woff2 files, or set up a small repo that reproduces the problem? |
@TheDancingCode sure, thanks for the offer: https://github.com/simondib/gulp-rev-test Note the fonts inside Then after:
.. note now inside the CSS the double appended revision hash to the woff2 reference (as well as truncating the file extension from .woff2 -> .woff) |
Alright. This is another instance of #47. I'm working on a solution. |
gulp task:
`gulp.task('rev-update-references', function(){
const manifest = gulp.src(getBuildRoot() + '/' + config.tasks.production.manifest)
return gulp.src(path.join(getBuildRoot() + '//.{css,js,json}'))
.pipe(revReplace({manifest: manifest}))
.pipe(gulp.dest(getBuildRoot()))
})`
scss:
`@font-face {
font-family: "Source Sans Pro";
font-style: normal;
font-weight: 400;
src: url(sourcesanspro-regular-webfont.woff) format("woff"),
url(sourcesanspro-regular-webfont.woff2) format("woff2")
}
body {
font-family: "Source Sans Pro";
}`
resulting css:
`@font-face {
font-family: Source Sans Pro;
font-style: normal;
font-weight: 400;
src: url(sourcesanspro-regular-webfont.woff?v=5a29a8b022) format("woff"),
url(sourcesanspro-regular-webfont.woff?v=5a29a8b0222?v=84061ed321) format("woff2")
}
body {
font-family: Source Sans Pro
}`
Problem: inside the compiled CSS the .woff2 filename is truncating the "2" in the extension, plus appending an extra (unknown) hash.
Has anyone faced a similar issue? Or can anyone confirm if woff2 is being rev'd correctly inside their referenced CSS?
The text was updated successfully, but these errors were encountered: