feat(build): builds use a chunk group hash #16389
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
webpackCompilationHash
is currently used inpage-data.json
& HTML files to decipher whether the Gatsby app running in the browser is at the same version as the code on the server/CDN.At the moment this hash changes if anything within
./src
has changed between builds. Meaning a 404 file could be changed which would result in allpage-data.json
& HTML files being updated even if they have not changed between builds.This causes some issues when using some cloud CDN providers as described in this issue #15872 .
This PR now constructs the
webpackCompilationHash
from hashes for each named chunk in webpack. Meaning that if a page or any associated files are changed between builds, only those files that have been updated will receive a newwebpackCompilationHash
, allowing for diffs to take place between what is hosted in a CDN and what is about to be pushed to a CDN.Related Issues
closes #15872