https://github.com/thundernet8/vite-plugin-auto-css-modules
same as babel-plugin-auto-css-modules but for vite
https://github.com/thundernet8/vite-plugin-auto-css-modules
Last synced: 11 months ago
JSON representation
same as babel-plugin-auto-css-modules but for vite
- Host: GitHub
- URL: https://github.com/thundernet8/vite-plugin-auto-css-modules
- Owner: thundernet8
- License: mit
- Created: 2021-03-01T10:00:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T12:56:49.000Z (over 3 years ago)
- Last Synced: 2025-02-01T08:02:56.009Z (over 1 year ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-auto-css-modules
same as babel-plugin-auto-css-modules but for vite
## install
```bash
yarn add vite-plugin-auto-css-modules -D
```
## usage
```ts
// vite.config.ts
import { defineConfig } from 'vite';
import autoCSSModulePlugin from 'vite-plugin-auto-css-modules';
export default defineConfig({
// ... other config
plugins: [
autoCSSModulePlugin(),
],
});
```
```tsx
// this will be modulized css
import $ from './index.css';
// this will be normal css
import './index.css';
// you do not need to name your style file to xx.module.css
```