Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow to only generate source map for CSS files #4456

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

chenjiahan
Copy link
Member

Summary

When JS source map is disabled, but CSS source map is enabled, we should add the SourceMapDevToolPlugin to let Rspack generate CSS source map.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 35187aa
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/679a058de27d7500081e43b1
😎 Deploy Preview https://deploy-preview-4456--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan merged commit 5d22226 into main Jan 29, 2025
10 checks passed
@chenjiahan chenjiahan deleted the css_source_map_0129 branch January 29, 2025 10:53
rsbuildConfig: {
output: {
sourceMap: {
js: false,
Copy link
Contributor

@Timeless0911 Timeless0911 Jan 29, 2025

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe CSS source maps are also inlined? If not, PR welcome~

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can create an Rspack issue to track this, especially as this can be a problem when using experiments.css.

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

Successfully merging this pull request may close these issues.

[Bug]: output.sourceMap.css: true does not take effect
2 participants