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
|`classnameTransform`|`asIs`| See [`classnameTransform`](#classnameTransform) below. |
103
+
|`customMatcher`|`"\\.module\\.(c\|le\|sa\|sc)ss$"`| Changes the file extensions that this plugin processes. |
104
+
|`customRenderer`|`false`| See [`customRenderer`](#customRenderer) below. |
105
+
|`customTemplate`|`false`| See [`customTemplate`](#customTemplate) below. |
106
+
|`jumpToDefinition`|`false`| Enables jump to definition, with limited compatibility. See [`jumpToDefinition`](#jumpToDefinition) below. |
107
+
|`namedExports`|`true`| Enables named exports for compatible classnames. |
108
+
|`dotenvOptions`|`{}`| Provides options for [`dotenv`](https://github.com/motdotla/dotenv#options). |
109
+
|`postcssOptions`|`{}`| See [`postcssOptions`](#postcssOptions) below. |
110
+
|`rendererOptions`|`{}`| See [`rendererOptions`](#rendererOptions) below. |
110
111
111
112
```json
112
113
{
@@ -142,7 +143,7 @@ When a custom renderer is provided, not other renderers will be used.
142
143
143
144
The path to the `customRenderer` must be relative to the project root (i.e. `./myRenderer.js`).
144
145
145
-
The custom renderer itself should be a JavaScript file. The function will be called with three arguments: a `css` string, an `options` object (see [`options.ts`](https://github.com/mrmckeb/typescript-plugin-css-modules/blob/main/src/options.ts#L33-L41)), and a `compilerOptions` object - which contains options as set in your `tsconfig.json`. It must be synchronous, and must return valid CSS.
146
+
The custom renderer itself should be a JavaScript file. The function will be called with three arguments: a `css` string, an `options` object (see [`options.ts`](https://github.com/mrmckeb/typescript-plugin-css-modules/blob/main/src/options.ts#L22-L34)), and a `compilerOptions` object - which contains options as set in your `tsconfig.json`. It must be synchronous, and must return valid CSS.
146
147
147
148
```js
148
149
module.exports= (css, { fileName, logger }) => {
@@ -192,6 +193,12 @@ The [internal `logger`](https://github.com/mrmckeb/typescript-plugin-css-modules
192
193
193
194
The `classes` object represents all the classnames extracted from the CSS Module. They are available if you want to add a custom representation of the CSS classes.
194
195
196
+
#### `jumpToDefinition`
197
+
198
+
This allows an editor like Visual Studio Code to jump to a classname's definition (file and line).
199
+
200
+
This is experimental, and only works with Sass (for now) and may not always work as expected.
0 commit comments