Skip to content
Discussion options

You must be logged in to vote

🧠 The "Internal Pipeline" Fix: Move Lightning CSS into PostCSS

The reason your CSS is being "un-minified" is that Rsbuild's default Lightning CSS loader runs after PostCSS. Even if cssnano minifies the string, the subsequent Lightning CSS loader receives that string, parses it, applies transforms, and then re-serializes (pretty-prints) it into the JS bundle.

To fix this and ensure cssnano is the final serializer, you should move Lightning CSS into the PostCSS chain.

1. Install the PostCSS bridge

npm install postcss-lightningcss cssnano -D

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by zalishchuk
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ghost
Comment options

@ghost
Comment options

@zalishchuk
Comment options

@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant