-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
CSS Modules not included with import statment and resolve alias #8245
Comments
v2.9.1 works but v2.9.2 does not work. |
The root cause here is vite/packages/vite/src/node/plugins/importAnalysisBuild.ts Lines 170 to 190 in 75c3bf6
This is another bug with the same root cause I come up with. |
Describe the bug
CSS module imports are not generated correctly (empty string instead of object holding class names) under the following conditions:
import styles from "custom:css"
React.lazy
vite build
- undervite dev
, this bug does not occur!Example (also in the reproduction linked below):
Generated code:
I would expect
s
here to be something like{"theClass": "hashedClassName"}
and not an empty string.In the reproduction, navigate to
dist/assets/App.hash.js
to see the faulty output.Reproduction
https://stackblitz.com/edit/vitejs-vite-sdjzjs?file=vite.config.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: