0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset
Matthew Lee 9aaf58c133
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>
2024-08-07 15:55:27 +01:00
..
config.json Enter pre mode for Astro 4 beta 2023-11-16 21:53:20 +08:00
dull-taxis-warn.md fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById (#11600) 2024-08-02 16:31:32 +02:00
happy-zebras-clean.md Actions: Add devalue for serializing complex values (#11593) 2024-08-05 08:22:38 -04:00
README.md Migrate to yarn monorepo (#157) 2021-04-30 16:33:35 -05:00
shy-bees-look.md fix: audit incorrectly flagging images as above the fold (#10891) (#11617) 2024-08-05 13:29:20 +02:00
tiny-poems-battle.md Actions: fix 500 on empty object for Vercel serverless (#11634) 2024-08-06 11:54:42 -04:00
young-pillows-shave.md Consistent file hashes (#11628) 2024-08-07 15:55:27 +01:00

Changesets

Hello and welcome! This folder has been automatically generated by @changesets/cli, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it in our repository

We have a quick list of common questions to get you started engaging with this project in our documentation