vite-plugin-gen-typed-css-modules
v0.1.1
Published
Generate type definition files for css or sass or less modules
Downloads
80
Maintainers
Readme
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
})
],
});