terence55 / themes-switch

Toolset for switch multiple themes in application based on webpack
54 stars 18 forks source link

Offer a contenthash naming for better cacheability #32

Open leonard84 opened 2 years ago

leonard84 commented 2 years ago

The useStaticThemeName only toggles between a fixed name, or one with a randomly generated number.

Webpack bundles can use contenthash, e.g. filename: '[name].[contenthash].js' this has the advantage that the hash stays the same as long as the content is still the same. This prevents unnecessary cache misses when the app is rebuild, but the css didn't actually change.