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
@@ -113,7 +122,7 @@ When a custom renderer is provided, not other renderers will be used.
113
122
114
123
The path to the `customRenderer` must be relative to the project root (i.e. `./myRenderer.js`).
115
124
116
-
The custom renderer itself should be a JavaScript file. The function will be called with two arguments: a `css` string, and an `options` object (see [`options.ts`](https://github.com/mrmckeb/typescript-plugin-css-modules/blob/master/src/options.ts#L33-L41)). It must be synchronous, and must return valid CSS.
125
+
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/master/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.
117
126
118
127
```js
119
128
module.exports= (css, { fileName, logger }) => {
@@ -130,6 +139,10 @@ You can find an example custom renderer in our test fixtures ([`customRenderer.j
130
139
131
140
The [internal `logger`](https://github.com/mrmckeb/typescript-plugin-css-modules/blob/master/src/helpers/logger.ts) is provided for [debugging](#troubleshooting).
132
141
142
+
> If you use Webpack, note that tilde (`~`) imports not supported by Less and Sass natively.
143
+
>
144
+
> For Less users, this package exports a customRenderer that enables tilde imports: [`less-plugin-aliases`](https://github.com/dancon/less-plugin-aliases).
145
+
133
146
#### `customTemplate`
134
147
135
148
The `customTemplate` is an advanced option, letting you provide a template for the generated TypeScript declarations.
0 commit comments