Skip to content

Commit

Permalink
Merge branch 'main' into 237-current-custommatcher-does-not-match-sty…
Browse files Browse the repository at this point in the history
…lus-files
  • Loading branch information
mrmckeb authored Feb 11, 2024
2 parents 5fd45f7 + df465eb commit d5643bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ If you're not using Visual Studio Code or are having trouble with the above meth

You can include these logs with any issues you open for this project.

### Disabling the plugin

If you need to temporarily disable this plugin, or disable it for a single user, you can do that by setting the `DISABLE_TS_PLUGIN_CSS_MODULES` environment variable to any value, and then restarting your IDE.

Note that this doesn't actually disable the plugin, but causes it to bail out early. See PR #244 for more information.

## About this project

This project was inspired by a Create React App [issue](https://github.com/facebook/create-react-app/issues/5677)
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const getPostCssConfigPlugins = (directory: string) => {
};

const init: tsModule.server.PluginModuleFactory = ({ typescript: ts }) => {
if (process.env.DISABLE_TS_PLUGIN_CSS_MODULES !== undefined) {
return {
create: (info: tsModule.server.PluginCreateInfo) => info.languageService,
};
}

let _isCSS: isCSSFn;

function create(
Expand Down

0 comments on commit d5643bd

Please sign in to comment.