-
Notifications
You must be signed in to change notification settings - Fork 171
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(core): Disable buildin lightingcss when inject style #3254
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why do we need to disable builtin lightingcss when using injectStyles
?
Get. I believe this fix is not the optimal solution as it prevents PostCSS and LightningCSS from working together. We can solve this problem by simply adding a |
Sorry, we should not change the order of lightningcss-loader and postcss-loader, this is an unexpected change. Take Tailwind CSS as an example. Tailwind CSS it is a PostCSS plugin, it will generate some CSS code, then Lightning CSS will add vendor prefixes to those CSS properties. If we change the loader order, this will be broken. |
If we need to adjust the default loader behavior, it is best to first discuss the impact of doing so. |
Summary
For production builds, it is recommended to use the default behavior of Rsbuild, which extracts CSS into separate bundles to allow browsers to load CSS and JS assets in parallel.
Related Links
[Bug]: rsbuild injectStyles
Checklist