-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: Generated CSS is erroneously cached #30225
Comments
Hi @Kludgy4 Thank you for opening this issue. I am not sure whether we can do much about it. Storybook itself doesn't use the What happens if you build your Angular application. Do you also see that css files don't have hashes in the file names? |
My CSS output has a hash when built normally with the angular cli. The main difference here I suppose is that storybook angular still uses the old Webpack build system as opposed to the new Angular 17+ |
I see. I think it makes a ton of sense for Storybook to apply your workaround internally in our code so that users don’t have to do it. I will prepare a PR this week. Thanks again for opening up the issue and letting us know about your workaround. |
Brilliant, thank you @valentinpalkovic |
On this, I assume that updating storybook to use the new build system would fix this problem. The storybook v8 announcement post hints that this will come in the next major version of storybook
|
Describe the bug
I want Cloudflare to cache CSS, JS, and images from the site.
This currently works for JS because of the cache busting contenthash
filename: '[name].[contenthash:8].iframe.bundle.js',
in the default storybook webpack settings.Other resources are similarly cached
However, CSS does not have the contenthash added into the MiniCssExtractPlugin filename.
This means that when I update the CSS used by my storybook - it does not update and instead uses the outdated cached version of
main.css
.Please update the default MiniCssExtractPlugin settings to use something like
Reproduction link
Can't reproduce easily due to Cloudflare caching dependency
Reproduction steps
main.css
System
Additional context
I am currently fixing this by manually modifying the webpack config
The text was updated successfully, but these errors were encountered: