-
Notifications
You must be signed in to change notification settings - Fork 69
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
Contenthash name pattern not honored when optimizing CSS #56
Comments
From webpack maintainers I was told that this is actually an issue on this plugin, which should indicate to webpack that content has changed and thus |
Currently You are right the content hash should be honored. Waiting for webpack/loader-utils#112 to be solved so i can have an idea how to implement this. The problem from the plugins perspective is that the filename is already generated, we need a way to know that a content hash is present in the file name and re calculate it. |
Just in case it went unnoticed: the feature required for this landed in |
Since there's not much going on with this issue one possible workaround until it's fixed is to add |
I'm not seeing this problem anymore in webpack 5 and optimize-css-assets-webpack-plugin 5. Can you see it or is it resolved for you too? |
I am experiencing an issue with webpack that turns out to be quite problematic when combined with a CDN and SRI. I am unsure if the issue is actually on
optimize-css-assets-webpack-plugin
or onwebpack
side, but here there are the reproduction steps:You can find a minimal example in this repo https://github.com/albertfdp/optimize-css-assets-plugin-contenthash
You can see that there are 2 webpack configurations, with the only difference being the options passed to
OptimizeCSSAssetsPlugin
:Also, bear in mind that I am using:
This results in 2 files being generated, both with the same name, but with different content (contenthash):
Therefore, if this happens in 2 consecutive builds, and the first time the assets are uploaded to a CDN, when requesting the CSS file, the SRI hash won't match and 💥.
The text was updated successfully, but these errors were encountered: