You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,6 +29,22 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
28
29
-[Troubleshooting](#troubleshooting)
29
30
-[About this project](#about-this-project)
30
31
32
+
## About this plugin
33
+
34
+
This plugin provides type information to IDEs and any other tools that work with [TypeScript language service plugins](https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin#whats-a-language-service-plugin).
35
+
36
+
At this time, TypeScript does not support plugins during compilation. This means that this plugin cannot:
37
+
38
+
- provide errors during compilation, or
39
+
- add CSS module support to your project.
40
+
41
+
For more information, and/or to add support for this feature, see: https://github.com/microsoft/TypeScript/issues/16607.
42
+
43
+
If you need a different solution, these projects might help:
44
+
45
+
- For Jest support, see https://www.npmjs.com/package/jest-css-modules-transform (one of a few options).
46
+
- For Webpack configuration, see https://webpack.js.org/loaders/css-loader/#pure-css-css-modules-and-postcss for an example.
47
+
31
48
## Installation
32
49
33
50
To install with Yarn:
@@ -54,6 +71,8 @@ Once installed, add this plugin to your `tsconfig.json`:
54
71
55
72
If you're using Visual Studio Code, please also follow these [instructions](#visual-studio-code).
56
73
74
+
As Webpack configurations vary, you may need to provide additional [options](#options) to this plugin to match your project configuration. For Create React App users, this plugin will work without additional configuration.
75
+
57
76
### Importing CSS
58
77
59
78
A default export is always provided for your CSS module.
@@ -179,10 +198,11 @@ The `classes` object represents all the classnames extracted from the CSS Module
|`less`|`{}`| Set [renderer options for Less](http://lesscss.org/usage/#less-options). |
204
+
|`sass`|`{}`| Set [renderer options for Sass](https://sass-lang.com/documentation/js-api#options). |
205
+
|`stylus`|`{}`| Set [renderer options for Stylus](https://stylus.bootcss.com/docs/js.html). |
186
206
187
207
> For convenience, `includePaths` for Sass are extended, not replaced. The defaults are the path of the current file, and `'node_modules'`.
188
208
@@ -212,7 +232,7 @@ If your project doesn't already have global declarations for CSS Modules, you wi
212
232
213
233
Where you store global declarations is up to you. An example might look like: `./src/custom.d.ts`.
214
234
215
-
The below is an example that you can copy or modify. If you use a `customMatcher`, you'll need to modify this.
235
+
The below is an example that you can copy or modify (you only declarations for exensions used in your project). If you use a `customMatcher`, you'll need to modify this.
0 commit comments