Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsonz1993/vite-plugin-load-css-module
:guardsman:A plugin to extend vite's css module rules, not just ".module" suffix
https://github.com/jsonz1993/vite-plugin-load-css-module
Last synced: 15 days ago
JSON representation
:guardsman:A plugin to extend vite's css module rules, not just ".module" suffix
- Host: GitHub
- URL: https://github.com/jsonz1993/vite-plugin-load-css-module
- Owner: jsonz1993
- Archived: true
- Created: 2022-02-10T09:11:33.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T08:40:34.000Z (over 2 years ago)
- Last Synced: 2024-09-19T03:10:30.933Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 576 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# vite-plugin-load-css-module
💂♂️A plugin to extend vite's css module rules, not just ".module" suffix。
Use the resolveId hook to trick the vite css plugin by returning the filename as '.module.css'.
# Install
```
npm i vite-plugin-load-css-module -D
```# Usage
```typescript
import { defineConfig } from 'vite'
import loadCssModulePlugin from 'vite-plugin-load-css-module';// https://vitejs.dev/config/
export default defineConfig({
...
plugins: [
loadCssModulePlugin({
include: id => id.endsWith('less') && !id.includes('node_modules'),
})
]
...
})
```# Example
[https://github.com/jsonz1993/vite-plugin-load-css-module/tree/master/playground](https://github.com/jsonz1993/vite-plugin-load-css-module/tree/master/playground)
[Post](https://github.com/jsonz1993/blog/issues/38)