fix: include content in css sourcemap when extracting #1627
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.
Hi 👋
Without source map contents included (which is the default behavior of rollup sourcemaps) it makes them less useful.
For example if you explore the

app.css
andapp.css.map
for thefixtures/react-library-example
workspace on [https://evanw.github.io/source-map-visualization] the mappings lead to empty files:With this PR the mappings now preserve the CSS that were initially omitted:
Richer sourcemaps are especially useful when vanilla extract is the first step, and later on
lightningcss
,cssnano
orpostcss
is operating on the extracted CSS asset. In those scenarios it's helpful to know what the CSS looked like before it was optimized and possibly deduped 😌Thanks so much for #1604 and #1616 btw. At Sanity we've decided to move away entirely from
styled-components
;vanilla-extract
is shaping up to become its replacement. Since our tooling is leaning heavily onrollup
, with the long term goal of moving torolldown
, these recent improvements were helpful and appreciated ❤