summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/src
diff options
context:
space:
mode:
authorGravatar Matthew Lee <mdlee.md+github@gmail.com> 2024-08-07 09:55:27 -0500
committerGravatar GitHub <noreply@github.com> 2024-08-07 15:55:27 +0100
commit9aaf58c1339b54f2c1394e718a0f6f609f0b6342 (patch)
tree9ac04e57013ca52b09fca0717274495d5051270f /packages/integrations/svelte/src
parentca45fd93c14f9f03cdecabd47a7e4b67ff001a12 (diff)
downloadastro-9aaf58c1339b54f2c1394e718a0f6f609f0b6342.tar.gz
astro-9aaf58c1339b54f2c1394e718a0f6f609f0b6342.tar.zst
astro-9aaf58c1339b54f2c1394e718a0f6f609f0b6342.zip
Consistent file hashes (#11628)
* Fix css plugin having inconsistent builds in different environments Astro's css plugin generates chunk ids that include a hash of all of the chunk's parent ids. These ids are currently the absolute file paths of the parent files. The generated chunk ids are then inserted into those pages as import statements. Because these import statements include a hash based on these absolute file paths, this causes rollup to generate different hashes for those pages when a build is run in different environments. The exact same project will produce identical assets with different filenames when built on different machines, or when built from different directories on the same machine, etc. To fix this, I've stripped out the working directory of these file paths before they are added to the hash. This means that the hash will still change if the files referencing it chacnge (which I believe is the intended behavior), but will be stable if the entire project is built in different environments. * add changeset * fixup! use settings.config.root and vite's normalizePath I've chosen to update the function signature of shortHashedName to match createSlugger's, so it now accepts the settings object and returns the actual hashing function. This way, createSlugger's function signature doesn't need to update to needlessly accept an additional argument. * fixup! remove unused import * Update .changeset/young-pillows-shave.md Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * fixup! use fileURLtoPath --------- Co-authored-by: Matt Lee <mdlee.md@gmail.com> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Diffstat (limited to 'packages/integrations/svelte/src')
0 files changed, 0 insertions, 0 deletions