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
As loader uses output of `css-loader`, generated typings depends on it's options.
38
+
### `namedExport`
39
+
When the option is switched on classes exported as variables. Be sure you using `camelCase` option of [css-loader](https://github.com/webpack-contrib/css-loader) to avoid invalid name of variables.
42
40
43
-
When [exportOnlyLocals](https://github.com/webpack-contrib/css-loader#exportonlylocals) is on, class names exported as variables:
44
41
```ts
42
+
// This file is generated automatically.
45
43
exportconst button:string;
46
44
exportconst buttonActive:string;
47
45
```
48
-
Be sure you using [camelCase](https://github.com/webpack-contrib/css-loader#camelcase) to avoid invalid name of variables.
49
46
50
-
When option is off, will be generated following typings:
47
+
When option is off:
51
48
```ts
49
+
// This file is generated automatically.
52
50
exportinterfaceI_buttonScss {
53
-
'paButton':string;
54
-
'paButtonActive':string;
51
+
'button':string
52
+
'buttonActive':string
55
53
}
56
-
exportconst locals:I_buttonScss;
54
+
declareconst styles:I_buttonScss;
55
+
exportdefaultstyles;
57
56
```
58
57
59
-
## Usage in Typescript
60
-
61
-
With `exportOnlyLocals`:
62
-
```ts
63
-
import*asclassesfrom'./_button.scss';
64
-
```
58
+
### `banner`
59
+
Adds a "banner" prefix to each generated file.
65
60
66
-
Without:
61
+
## Usage in Typescript
67
62
```ts
68
-
import{ localsasclasses }from'./_button.scss';
63
+
import*asstylesfrom'./_button.scss';
69
64
```
70
65
71
66
To avoid errors about the absent module, you need to determine this:
@@ -78,7 +73,7 @@ declare module '*.scss' {
78
73
export=classes;
79
74
}
80
75
```
81
-
When you add new class name, Typescript compiler may not find the generated variable so you need to compile twice your files.
76
+
When you add new classname Typescript compiler may not find the generated variable so you need to compile twice your files.
0 commit comments