fix: allow to only generate source map for CSS files#4456
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| rsbuildConfig: { | ||
| output: { | ||
| sourceMap: { | ||
| js: false, |
There was a problem hiding this comment.
I remember that when output.sourceMap.js is set to eval-* or inline-* as well as output.sourceMap.css: true, the css sourcemap would not be generated too.
There was a problem hiding this comment.
Maybe CSS source maps are also inlined? If not, PR welcome~
There was a problem hiding this comment.
Yeah, this means the type of css sourcemap is determined by which of Javascript devtool configuration. And eval devtool can not take effect in css since css can not be wrapped by eval, so it is as expected? And for inline-* devtool configuration, the css sourcemap is correctly inlined after I verify.
There was a problem hiding this comment.
We can create an Rspack issue to track this, especially as this can be a problem when using experiments.css.

Summary
When JS source map is disabled, but CSS source map is enabled, we should add the
SourceMapDevToolPluginto let Rspack generate CSS source map.Related Links
output.sourceMap.css: truedoes not take effect #4397Checklist