css-module-types

0.2.2 • Public • Published

css-module-types

TypeScript Language Service Plugin for CSS modules.

Real-time autocompletion and validation of exports. Use alongside your build tool, such as webpack + css-loader or browserify + css-modulesify.

screenshot

Install

npm install --save-dev css-module-types

Usage

Add declaration to global.d.ts:

declare module '*.css' {
  const exports: { [exportName: string]: string };
  export = exports;
}

Add plugin to tsconfig.json:

{
  "compilerOptions": {
    "plugins": [ { "name": "css-module-types" } ],
    ...
  },
  "include": [
    "global.d.ts",
    ...
  ]
}

Package Sidebar

Install

npm i css-module-types

Weekly Downloads

167

Version

0.2.2

License

Apache-2.0

Last publish

Collaborators

  • timkang