Open Maxou44 opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
This is not supported because export const for = ''
is not valid. We'll need https://github.com/rollup/plugins/issues/1437 to be implemented.
related: https://github.com/vitejs/vite/issues/11359
You can import the default import instead for a workaround.
import style from './style.module.css';
@Maxou44
I've implemented a fix via https://github.com/privatenumber/vite-css-modules (which is getting integrated into Vite core via https://github.com/vitejs/vite/pull/16018).
Would you mind testing it out to see if it resolves your issue?
EDIT: Confirmed working via https://github.com/privatenumber/vite-css-modules/commit/9fdfa5bdbcd246ca7e9fd3a79f5c6a156a35a181
@privatenumber Tested and it works, thanks for the fix 💪
Describe the bug
When using CSS modules and importing to obtain computed class names, classes named using a JS reserved keywords are not available and return undefined.
There is no console warning or information in the documentation about that, and this test works on Webpack and Parcel.
As the following code is valid in JS, I don't think it should be a problem to support it:
Reproduction
https://stackblitz.com/edit/vitejs-vite-qmdhmt?file=main.js
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations