Disable hashed file names for font files
See original GitHub issueHere’s an example, I’m loading some fonts:
@font-face {
font-family: "Flaticon";
src: url("./font/Flaticon.eot");
src: url("./font/Flaticon.eot?#iefix") format("embedded-opentype"),
url("./font/Flaticon.woff") format("woff"),
url("./font/Flaticon.ttf") format("truetype"),
url("./font/Flaticon.svg#Flaticon") format("svg");
font-weight: normal;
font-style: normal;
}
The font files will never ever change.
And yet, for every build:
A new hashed file name is generated, meaning after every deploy, my users have to download the fonts over and over, just because the name changed.
I’d like to keep the hashed file names for CSS/JS and all, but why are font file names hashed by default? And what’s the solution to this? I want no name hashing for font file.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Webpack 5: file-loader generates a copy of fonts with hash ...
In this case, we want to use our own file-loader and disable the Asset Module . We can set the type to 'javascript/auto'....
Read more >Adding Hashes to Filenames - SurviveJS
The files have neat hashes now. To prove that it works for styling, you could try altering src/main.css and see what happens to...
Read more >Loading Fonts with webpack - Chris Courses
I tried to copy fonts in ./font folder BUT afer bundling there was font files with long "hash" names (like 13513397853535314.ttf) in ./dist ......
Read more >Stop vite from adding hash/hex to specific css stylesheet on ...
My whole ViteJS config is below. Does anyone know how to compile without adding the hash/hex in the filename? Current output filename on...
Read more >How to use @font-face in CSS
It's true, @font-face can load a font file full of icons that can be used ... up the font files family name, fontname...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bot not now
I can see
'static/media/[name].[hash:8].[ext]'
for thefile-loader
. Maybe[contenthash]
would make more sense.