@vdegenne/vite-plugin-css-modules
v0.1.12
Published
``` npm i -D @vdegenne/vite-plugin-css-modules ```
Downloads
12
Readme
Installation
npm i -D @vdegenne/vite-plugin-css-modulesUsage
Add the plugin to vite
import {cssModules} from '@vdegenne/vite-plugin-css-modules'
plugins: [cssModules()]Then in your code importing a stylesheet like that
import styles from './stylesheet.css' with {type: 'css'}will resolve the import to a CSSStyleSheet containing the styles defined in the file.
Add @vdegenne/vite-plugin-css-modules/css in tsconfig.json types to override vite "*.css" imports if you need.
