Create-react-app: Disable hashed file names for font files

Created on 9 Jul 2020  路  5Comments  路  Source: facebook/create-react-app

Here'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:

image

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.

bug report needs triage stale

Most helpful comment

Bot not now

All 5 comments

I can see 'static/media/[name].[hash:8].[ext]' for the file-loader. Maybe [contenthash] would make more sense.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Bot not now

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

wereHamster picture wereHamster  路  3Comments

ap13p picture ap13p  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

jnachtigall picture jnachtigall  路  3Comments