Package Exports
- vite-plugin-load-css-module
- vite-plugin-load-css-module/dist/index.js
- vite-plugin-load-css-module/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vite-plugin-load-css-module) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 -DUsage
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