Skip to content

jhwz/vite-plugin-typed-css-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

Generates typed definitions for css modules

Resources

Stars

Watchers

Forks

Packages

No packages published