Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vite-plugin-load-css-module

jsonz19931.7kISC0.1.4TypeScript support: included

A plugin to extend vite's css module rules, not just ".module" suffix

vite, vite-plugin, css-module

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

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

Post

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.1.4 (2022-03-24)

Bug Fixes

0.1.3 (2022-03-01)

Bug Fixes

  • system differences lead to inconsistent paths (#6) (90c5c3c), closes #3 #5