-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Non deterministic build with cssCodeSplit = false
and css imports
#16582
Labels
Comments
|
susnux
added a commit
to susnux/vite
that referenced
this issue
May 3, 2024
Resolves vitejs#16582 When setting `cssCodeSplit: false` the styles are still split into one style file. But currently the imported CSS results in empty chunks, as in the current implementation empty chunks are only removed when `cssCodeSplit` was set to `true`. So this also adds empty style chunks to `pureCSSChunks` even with `cssCodeSplit: false`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
susnux
added a commit
to susnux/vite
that referenced
this issue
May 3, 2024
Resolves vitejs#16582 When setting `cssCodeSplit: false` the styles are still split into one style file. But currently the imported CSS results in empty chunks, as in the current implementation empty chunks are only removed when `cssCodeSplit` was set to `true`. So this also adds empty style chunks to `pureCSSChunks` even with `cssCodeSplit: false`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
susnux
added a commit
to susnux/vite
that referenced
this issue
May 3, 2024
Resolves vitejs#16582 When setting `cssCodeSplit: false` the styles are still split into one style file. But currently the imported CSS results in empty chunks, as in the current implementation empty chunks are only removed when `cssCodeSplit` was set to `true`. So this also adds empty style chunks to `pureCSSChunks` even with `cssCodeSplit: false`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
susnux
added a commit
to susnux/vite
that referenced
this issue
May 3, 2024
Resolves vitejs#16582 When setting `cssCodeSplit: false` the styles are still split into one style file. But currently the imported CSS results in empty chunks, as in the current implementation empty chunks are only removed when `cssCodeSplit` was set to `true`. So this also adds empty style chunks to `pureCSSChunks` even with `cssCodeSplit: false`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
9 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
If I set
cssCodeSplit
tofalse
and have css files imported this leads to empty chunks named likestyle-xyz
, but the name is changing on every vite build without changed source.Due to the changed name all files that imported that style are now also changing (as the import name changes, the content is different thus the hash is different, causing the file to rename).
Reproduction
https://stackblitz.com/edit/vitejs-vite-kkmede
Steps to reproduce
I could currently not reproduce the non-deterministic behavior (my setup is much more complex with plugins), but on the reproduction you can see an empty chunk is emitted for the style import.
System Info
System: OS: Linux 6.8 openSUSE Tumbleweed 20240429 CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics Memory: 3.93 GB / 14.98 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.1 - /usr/bin/node Yarn: 1.22.21 - /usr/bin/yarn npm: 10.5.0 - /usr/bin/npm Browsers: Chromium: 122.0.6261.128 npmPackages: vite: ^5.2.11 => 5.2.11
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: