You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect that there should not be any different behaviours whether cssCodeSplit is on. However, as shown in the reproduction link, I get diffenrent results with different status of cssCodeSplit:
cssCodeSplit: true
cssCodeSplit: false
See the reproduction for more information.
Analysis
This problem is basically an outcome of #9949, which tweaks the order of collecting deps such that styles of the importer override those of the imported chunks. But the order in the situation of cssCodeSplit set to false is still "parent-first", which is the same as the order of calling renderChunk, i.e. we collect the importer's styles first, then the imported chunks and so on.
For example, in the reproduction provided below, the style of Button is collected before the GreenButton if cssCodeSplit is true which is the opposite of what happens if cssCodeSplit is false.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Problem
I expect that there should not be any different behaviours whether
cssCodeSplit
is on. However, as shown in the reproduction link, I get diffenrent results with different status ofcssCodeSplit
:cssCodeSplit: true
cssCodeSplit: false
See the reproduction for more information.
Analysis
This problem is basically an outcome of #9949, which tweaks the order of collecting deps such that styles of the importer override those of the imported chunks. But the order in the situation of
cssCodeSplit
set tofalse
is still "parent-first", which is the same as the order of callingrenderChunk
, i.e. we collect the importer's styles first, then the imported chunks and so on.For example, in the reproduction provided below, the style of
Button
is collected before theGreenButton
ifcssCodeSplit
istrue
which is the opposite of what happens ifcssCodeSplit
is false.A possible fix is #11671
Reproduction
https://stackblitz.com/edit/vite-mlkxv1?file=main.jsx
Steps to reproduce
yarn serve-split
, a green button and a blue button will show in the preview windowyarn serve
will get a black button and a blue buttonSystem Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: