Skip to content

Commit 961e475

Browse files
authored
docs: add about section with limitations and reasons (#88)
1 parent 3cdd070 commit 961e475

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
1212
## Table of contents
1313

1414
- [typescript-plugin-css-modules](#typescript-plugin-css-modules)
15-
- [Table of contents](#table-of-contents)
15+
- [Table of contents](#about-this-plugin)
16+
- [About this plugin](#table-of-contents)
1617
- [Installation](#installation)
1718
- [Importing CSS](#importing-css)
1819
- [Options](#options)
@@ -28,6 +29,22 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
2829
- [Troubleshooting](#troubleshooting)
2930
- [About this project](#about-this-project)
3031

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+
3148
## Installation
3249

3350
To install with Yarn:
@@ -54,6 +71,8 @@ Once installed, add this plugin to your `tsconfig.json`:
5471

5572
If you're using Visual Studio Code, please also follow these [instructions](#visual-studio-code).
5673

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+
5776
### Importing CSS
5877

5978
A default export is always provided for your CSS module.

0 commit comments

Comments
 (0)