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
馃殌 Feature request: [contenthash] instead of [hash]
I think it should be possible to change the [hash:8] in file-loader to use [contenthash:8] which should mean that if you don't make changes to a file it wouldn't get a new hash when you rebuild.
Using [hash:8] would mean a per-build hash is used on the file so every build/deploy would invalidate the cache those media resources.
Desired Behavior
Using [contenthash:8] should make it a stable filename across builds as long as the content of the file doesn't change, meaning you can have longer lived caching on static files.
But I'm a bit confused at the config here because it seems like it's passing options to url-loader that it doesn't support. emitFile and name don't seem to be valid options https://webpack.js.org/loaders/url-loader/
Should url-loader be specifying a fallback to file-loader instead? I'm not exactly sure without spending more time investigating
The text was updated successfully, but these errors were encountered:
馃殌 Feature request: [contenthash] instead of [hash]
I think it should be possible to change the [hash:8] in
file-loader
to use[contenthash:8]
which should mean that if you don't make changes to a file it wouldn't get a new hash when you rebuild.https://github.com/jaredpalmer/razzle/blob/master/packages/razzle/config/createConfig.js#L159
Current Behavior
Using
[hash:8]
would mean a per-build hash is used on the file so every build/deploy would invalidate the cache those media resources.Desired Behavior
Using
[contenthash:8]
should make it a stable filename across builds as long as the content of the file doesn't change, meaning you can have longer lived caching on static files.Additional context
My initial thought was that this could also be applied to
url-loader
as well https://github.com/jaredpalmer/razzle/blob/master/packages/razzle/config/createConfig.js#L171But I'm a bit confused at the config here because it seems like it's passing options to
url-loader
that it doesn't support.emitFile
and name don't seem to be valid options https://webpack.js.org/loaders/url-loader/Should
url-loader
be specifying afallback
tofile-loader
instead? I'm not exactly sure without spending more time investigatingThe text was updated successfully, but these errors were encountered: