-
Hello! I'm in the process of attempting a port from webpack to vite, and I have the core functionality in my app working, but styling is broken. We're using PostCSS modules, and components reference styles like this: import styles from "./style.css";
function MyComponent () {
return (
<div className={styles.myStyle}>
...
</div>
)
} in debugging the issue, I found that with Vite, in dev, the styles object is just a string instead of the module object, so the components set My current vite config is this:
Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi! Please refer to the Vite.js Discord channel which is a great place to ask questions like this 😃 I would encourage you to use the |
Beta Was this translation helpful? Give feedback.
Hi! Please refer to the Vite.js Discord channel which is a great place to ask questions like this 😃
I would encourage you to use the
.module.css
extension as covered in the Vite.js docs, which is the officially supported way to import CSS modules.