@css-modules-kit/codegen
v0.6.0
Published
A tool for generating `*.d.ts` files for `*.module.css`.
Readme
@css-modules-kit/codegen
A tool for generating *.d.ts files for *.module.css.
Installation
npm i -D @css-modules-kit/codegenRequirements
Set cmkOptions.dtsOutDir and "." to rootDirs. This is necessary for the tsc command to load the generated *.d.ts files.
{
"compilerOptions": {
"rootDirs": [".", "generated"] // Required
},
"cmkOptions": {
"dtsOutDir": "generated" // Default is `"generated"`, so it can be omitted
}
}Usage
From the command line, run the cmk command.
$ # Generate .d.ts for .module.css
$ npx cmk
$ # Show help
$ npx cmk --help
Usage: cmk [options]
Options:
--help, -h Show help information
--version, -v Show version number
--project, -p The path to its configuration file, or to a folder with a 'tsconfig.json'.
--pretty Enable color and formatting in output to make errors easier to read.
--clean Remove the output directory before generating files. [default: false]