An open API service indexing awesome lists of open source software.

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

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
```