augmentChunkHash with extract: true breaks hashing
See original GitHub issueMy configuration looks like this:
postcss({
extract: true,
minimize: process.env.NODE_ENV === 'production'
})
https://rollupjs.org/guide/en/#augmentchunkhash
https://github.com/egoist/rollup-plugin-postcss/blob/master/src/index.js#L140
The augmentChunkHash
hook is used to augment the hash of chunks (entry js file + its dependencies), not assets, so I don’t understand why this is used. It’s not even filtering which chunk gets its hash augmented.
This is causing all my js files to have new a hash on every build, even when nothing has changed.
The extracted stylesheet’s hash should also not be based on the entry file’s hash, it should have its own independent hash.
Removing the augmentChunkHash
hook completely fixes first problem. rollup-plugin-postcss
will still need to hash the stylesheet based on its content.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
rollup-plugin-postcss - Bountysource
augmentChunkHash with extract : true breaks hashing $ 0. Created 2 years ago in egoist/rollup-plugin-postcss with 4 comments. My configuration looks like this:...
Read more >rollup.js
On the other hand, augmentChunkHash is now evaluated after renderChunk when the hash is created. As file hashes are now based on the...
Read more >egoist/rollup-plugin-postcss (Raised $0.00) - Issuehunt
augmentChunkHash with extract : true breaks hashing. Unfunded#315created bynstepien. $0.00. Hot Module Replacement (HMR). Unfunded#314created bynstepien.
Read more >rollup.js
You will only get a default export from CommonJS plugins ... Next Hook: augmentChunkHash for each chunk that would contain a hash in...
Read more >rollup changelog
Pull Requests · #3722: Add import specifiers to bundle information (@lukastaegert) · #3724: Fix missing variables for UMD and IIFE builds (@ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can go relatively far using something like patch-package to amend specific things until the maintainers have the time to look at the submitted PRs. To emit an asset together with its sourcemap you can do somenthing like the following (stolen from now deleted code in
rollup-plugin-svelte
):This function lets Rollup handle the naming and the hashing, using its
output.assetFileNames
conf. You can then completely removeaugmentChunkHash
, since the hashing is consistent with the extracted file content. If you use js dynamic imports that import css you may want to also look at #317 to avoid non deterministic source concatenation.Did anyone find a fork that fixes these kind of big/completely breaking bugs?