-
Notifications
You must be signed in to change notification settings - Fork 71
Conversation
7f93996
to
f7ef960
Compare
ac2694b
to
6e16ce9
Compare
- allow named exports via `namedExport` flag - add warnings if `namedExport` is used without camelCase option for css-loader and classes would get lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
@@ -30,7 +79,7 @@ webpackConfig.module.loaders: [ | |||
## Example | |||
|
|||
Imagine you have a file `~/my-project/src/component/MyComponent/component.scss` in your project with the following content: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be mycomponent.scss
.
@@ -54,6 +103,14 @@ declare const styles: IMyComponentScss; | |||
export default styles; | |||
``` | |||
|
|||
### using `namedExport` | |||
Using the `namedExport`-option the generated file will look as follow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Using the namedExport
as well as the camelCase
options ..."
} else { | ||
const [cleanedDefinitions, skippedDefinitions] = filterNonWordClasses(cssModuleKeys); | ||
if (skippedDefinitions.length > 0 && !query.camelCase) { | ||
console.warn(`Typings for CSS-Modules: option 'namedExport' was set but 'camelCase' for the css-loader not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful! 👍
### using `namedExport` | ||
Using the `namedExport`-option the generated file will look as follow: | ||
### using `namedExport` with the `camelCase`-option | ||
Using the namedExport as well as the camelCase options the generated file will look as follow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by copy pasting, the back ticks got lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nooo i will amend
cf328d7
to
bc77b55
Compare
Add option to generate named exports instead of an interface.
TODO:
named exports
generator