Skip to content
This repository has been archived by the owner on Dec 25, 2018. It is now read-only.

content hash doesn't change when content changes #117

Open
jpuck opened this issue Jun 21, 2017 · 1 comment
Open

content hash doesn't change when content changes #117

jpuck opened this issue Jun 21, 2017 · 1 comment

Comments

@jpuck
Copy link

jpuck commented Jun 21, 2017

purifycss-webpack: 0.7.0
purify-css: 1.2.5
node v7.5.0
npm 4.1.2

The contenthash is unreliable for cache breaking because it's calculated on the source css, so if the source html changes such that the purifier includes different content into the build, then the contenthash remains the same despite the fact that the file contents are now actually different.

Here is a repository to demonstrate the issue.

As you can see that adding additional markup to the html causes the purifier to not exclude the respective style, but the resulting contenthash for the build remains main.a4b8c75c90e070022e83e3602ea0b64b.css

If possible the contenthash from the ExtractTextPlugin should be re-calculated for the build product. At the very least this should be documented in the README, because I think as it stands the usage of the contenthash is somewhat misleading as it's generally relied upon for cache breaking.

@tony
Copy link

tony commented Aug 17, 2017

I can't recreate it, but can confirm that while the size of files changes, [hash] isn't.

And I can't isolate if it's this module or webpack itself (feeling a bit overwhelmed with all the conventions being thrown around to give a more useful report), but think it is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants