Fix CSS Modules using Vite x React (camelCase)

PHOTO EMBED

Wed Aug 23 2023 15:11:05 GMT+0000 (Coordinated Universal Time)

Saved by @thecowsays #vite #react

// place within vite.config.js

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  css: {
    modules: {
      localsConvention: "camelCase",
    },
  },
});
content_copyCOPY

This is the missing link in the vite.config.js file which will let your camelCase styles actually work.

https://youtu.be/Sgcfiow4fVQ?t=141