Why one single css file? Shall we bundle it with webpack or keep seperate? #448
-
|
I'm seeking to deepen my understanding of web development practices, particularly regarding the bundling of CSS files. In JavaScript, we often split bundles as code grows to optimize performance. However, when it comes to CSS, I notice that many projects output a single CSS file including
I'm keen to hear from developers with insights into these considerations and how they impact web development practices. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Re: 1 we have a whole section explaining this design decision: https://stylexjs.com/docs/learn/thinking-in-stylex/#one-small-file-over-many-smaller-files TLDR; With atomic CSS, we can generally ensure that the singe CSS file never gets too big.
No, because it's not a big bundle at all. It's a single small bundle.
This is not the case. Our Webpack plugin (and also NextJS) generates a separate CSS file. |
Beta Was this translation helpful? Give feedback.
Re: 1 we have a whole section explaining this design decision: https://stylexjs.com/docs/learn/thinking-in-stylex/#one-small-file-over-many-smaller-files
TLDR; With atomic CSS, we can generally ensure that the singe CSS file never gets too big.
No, because it's not a big bundle at all. It's a single small bundle.
This is not the case. Our Webpack plugin (and also NextJS) generates a separate CSS file.