CSS not included in lazy-loading legacy files in Vite 3.0.0-alpha.1 #8243
Labels
feat: css
p3-minor-bug
An edge case that only affects very specific usage (priority)
plugin: legacy
regression
The issue only appears after a new release
Milestone
Describe the bug
When using Vite 3.0.0-alpha.1, Legacy builds of lazy-loaded components don't have css included anymore. @vitejs/plugin-legacy does not seem to be the issue, I have tried both 1.8.2 and 2.0.0-alpha.0, neither would include css. When building with Vite 2.9.9, the css is in.
I include css through a simple import:
import './DateSelectLazy.css';
You can see my minimum reproduction code in https://github.com/X-Y/vite-base-path-ie11-problem-demo/tree/cssLostIn3
If you use instead https://github.com/X-Y/vite-base-path-ie11-problem-demo/tree/cssLostIn3-before3 and refresh the dependencies, the builds would have css included.
Reproduction
https://x-y.github.io/vite-base-path-ie11-problem-demo
If you open this page in ie11, and click the button, you can see the revealed text is not red.
If you look at the legacy file: https://x-y.github.io/vite-base-path-ie11-problem-demo/assets/DateSelectLazy-legacy.df3c73b5.js You would see that no css is included.
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: