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
|`customMatcher`|`"\\.module\\.(sa\|sc\|c)ss$"`| Change the file extensions that this plugin works with. |
38
+
|`camelCase`|`false`| Implements the behaviour of the [`camelCase` CSS Loader option](https://github.com/webpack-contrib/css-loader#camelcase) (accepting the same values). |
39
+
40
+
The below is an example that only matches "\*.m.css" files, and [camel-cases dashes](https://github.com/webpack-contrib/css-loader#camelcase).
34
41
35
42
```json
36
43
{
@@ -39,20 +46,40 @@ You can also pass in your own file extension matcher (the default matcher is sho
39
46
{
40
47
"name": "typescript-plugin-css-modules",
41
48
"options": {
42
-
"customMatcher": "\\.module\\.(sa|sc|c)ss$"
49
+
"customMatcher": "\\.m\\.css$",
50
+
"camelCase": "dashes"
43
51
}
44
52
}
45
53
]
46
54
}
47
55
}
48
56
```
49
57
58
+
### Visual Studio Code
59
+
60
+
By default, VSCode will use it's own version of TypeScript. To make it work with this plugin, you have two options:
61
+
62
+
1. Add this plugin to `"typescript.tsserver.pluginPaths"` in settings. Note that this method doesn't currently support
Depending on your project configuration, you may also need to declare modules. Where you store this is up to you. An
53
-
example might look like: `src/@types/custom.d.ts`.
76
+
_Note: Create React App users can skip this section if you're using `react-scripts@2.1.x` or higher._
77
+
78
+
If your project doesn't already have global declarations for CSS Modules, you will need to add these to help TypeScript understand the general shape of the imported CSS.
79
+
80
+
Where you store global declarations is up to you. An example might look like: `src/custom.d.ts`.
54
81
55
-
The below is an example that you can modify if you use a `customMatcher`.
82
+
The below is an example that you can copy, or modify if you use a `customMatcher`.
0 commit comments