Repository navigation
Resolve volatile asset placeholders before hashing CSS in incremental builds - #18062
Closed
astro-factory[bot] wants to merge 1 commit into
Closed
astro-factory[bot] wants to merge 1 commit into
astro-factory[bot] wants to merge 1 commit into
Conversation
1 task
🦋 Changeset detectedLatest commit: c5ebeea The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
This fixes the CSS reference but this is still an issue with imported assets in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
url()) now restore reliably on subsequent incremental builds instead of non-deterministically re-rendering. Vite's transform output for such CSS contains__VITE_ASSET__<handle>__placeholders where handles are assigned per-build and are not stable across runs. The compiled CSS branch inhashModules()was passing this raw output directly to the hasher, makingdependencyHashchange every build even when no source file changed.resolveAssetPlaceholders(graph, compiled)on the compiled CSS before hashing, replacing volatile placeholders with their stable content-hashed filenames — matching the treatment already applied to the non-CSS module code path.Testing
packages/astro/test/units/build/plugin-incremental.test.tsto cover the CSS-with-emitted-asset case: a route importing a stylesheet that references a font above the inline threshold should produce the samedependencyHashacross consecutive builds, regardless of the per-build asset handle assigned by the bundler.Docs
Closes #18058