Skip to content

fix: preserve output source indices when bundling CSS - #23

Open
intellild wants to merge 1 commit into
masterfrom
codex/rstack-fix-bundler-source-indices
Open

intellild wants to merge 1 commit into
masterfrom
codex/rstack-fix-bundler-source-indices

Conversation

@intellild

@intellild intellild commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Record the source ID returned by the output map and use it for mappings that point directly to a bundled CSS file.
  • Register the CSS source when its inline source map cannot be read.
  • Cover both cases with Parcel source map regression tests.

Example

If the output map already has existing.css at index 0, Bundler may assign entry.css stylesheet index 0 while the output map assigns it source ID 1. Previously its mappings pointed at existing.css. They now use the output map's ID for entry.css. The same fallback works when the CSS has an unreadable inline map.

Validation

  • Both regression cases failed on the previous master and pass with this change.
  • cargo test --locked -p rspack-lightningcss --no-default-features --features bundler --test test_parcel_bundler_source_map
  • cargo check --locked --workspace --all-features

Stack

  1. This PR
  2. Use std::fmt::Write for printer output
  3. Serialize CSS through PrinterTrait
  4. Introduce the custom_sourcemap feature flag
  5. Custom source maps through generic PrinterOptions

by OpenAI Codex

Copilot AI balanced review requested due to automatic review settings November 4, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T09:32:01.296218Z b391f63 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing codex/rstack-fix-bundler-source-indices (b391f63) with master (ec31b9a)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants