fix: preserve CSS entry names in manifest by using Map instead of Set#6662
Closed
fix: preserve CSS entry names in manifest by using Map instead of Set#6662
Conversation
Contributor
How to use the Graphite Merge QueueAdd the label graphite: merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
✅ Deploy Preview for rolldown-rs canceled.
|
- Updated CSSEntriesCache to use FxDashMap<String, ArcStr> instead of FxDashSet<ArcStr> - Modified vite_css_post_plugin to store chunk name → reference_id mapping - Updated manifest plugin to extract name from CSS entries map - Modified ManifestChunk to include optional name field - Updated TypeScript bindings to use Map<string, string> for cssEntries - Fixed test fixture to use Map instead of Set Co-authored-by: shulaoda <[email protected]>
Co-authored-by: shulaoda <[email protected]>
Copilot
AI
changed the title
[WIP] Port code from Vite CSS plugin to Rolldown
fix: preserve CSS entry names in manifest by using Map instead of Set
Oct 22, 2025
Contributor
Benchmarks Rust |
IWANABETHATGUY
pushed a commit
that referenced
this pull request
Oct 27, 2025
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.
Description
This PR ports the fix from vitejs/vite#20585 to rolldown's builtin vite-css plugin. The issue was that CSS entry point names were being incorrectly transformed in the manifest output (e.g.,
foo.scss→foo.css), making it impossible to locate CSS entries by their original names.Problem
When CSS files are used as entry points with custom names (e.g.,
styles/tailwind.scssorbar.custom), the manifest was:.cssextension regardless of the original nameThis broke use cases where:
.scss,.less, etc.)bar.custom)Solution
Changed the CSS entries tracking mechanism from a Set to a Map to preserve the original chunk names:
Key Changes
CSS Entries Storage: Changed from
Set<referenceId>toMap<chunkName, referenceId>Entry Tracking: Store chunk name along with reference ID
Manifest Output: Added
namefield with the unmangled entry nameExample
With an entry point named
styles/tailwind.scss, the manifest will now include:{ "styles/tailwind.scss": { "file": "assets/tailwind-abc123.css", "src": "styles/tailwind.scss", "isEntry": true, "name": "styles/tailwind.scss", "names": ["styles/tailwind.css"] } }The
namefield preserves the originalstyles/tailwind.scssentry name, whilenamesis kept for backward compatibility.Backward Compatibility
namesfield is preserved in the manifest output for backward compatibilitynamefield is added as an optional fieldTesting
Related
namesin the manifest with unmanglednamefor CSS assets vitejs/vite#20585Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.