Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 908 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 908 Bytes

vite-plugin-typed-css-modules

Generates typed definitions for css modules using typed-css-modules.

The plugin will set the vite config field css.modules.localsConvention to camelCaseOnly and sets the camelCase option in typed-css-modules.

Using the vite dev server watcher, any time a [name].module.css file is edited a [name].module.css.d.ts file will be rewritten.

Installation

npm install vite-plugin-typed-css-modules

Usage

// vite.config.js

import typedCssModulesPlugin from "vite-plugin-typed-css-modules";

/** @type {import('vite').UserConfig} */
const config = {
  plugins: [typedCssModulesPlugin()],
};

export default config;