[Vite CSS] css not loaded when build.cssCodeSplit: true
and build.modulePreload: false
#12273
Closed
7 tasks done
Labels
duplicate
This issue or pull request already exists
Describe the bug
According to the vite official site, when
build.cssCodeSplit
is "enabled, CSS imported in async chunks will be inlined into the async chunk itself and inserted when the chunk is loaded".Throughout the whole site, I just can't find any relation between
build.modulePreload
andbuild.cssCodeSplit
.However, when
build.modulePreload: false
andbuild.cssCodeSplit: true
are set, I find that the async css chunk is not "inlined into the async chunk itself", let alone loaded.BTW, with the command
grep -nr ${HASH_OF_CSS_CHUNK} ./dist
I found no match in those generated assets.My vite config is:
Reproduction
https://stackblitz.com/edit/vitejs-vite-qz7uvm?file=vite.config.js
Steps to reproduce
Open stackblitz.com and just run
npm run build
in the command line.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: