0.1.1 • Published 8 months ago

vite-plugin-gen-typed-css-modules v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

vite-plugin-gen-typed-css-modules

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

The plug-in will set the vite configuration 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/scss/less] file is edited a [name].module.[css/scss/less].d.ts file will be rewritten.

Installation

npm install vite-plugin-gen-typed-css-modules

Usage

// vite.config.js
/** @type {import('vite').UserConfig} */

import typedGenCssModulesPlugin from "vite-plugin-gen-typed-css-modules";

export default defineConfig({
  plugins: [
    typedGenCssModulesPlugin({
      cssExt: 'scss', // default css
    })
  ],
});