Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Add named exports option #4

Merged
merged 9 commits into from
Sep 23, 2016
Merged

Add named exports option #4

merged 9 commits into from
Sep 23, 2016

Conversation

timse
Copy link
Contributor

@timse timse commented Sep 19, 2016

Add option to generate named exports instead of an interface.

TODO:

  • add named exports generator
  • warn if classes would go missing due to filter for dashed-names
  • document option in readme

@timse timse force-pushed the add-named-exports-option branch from 7f93996 to f7ef960 Compare September 19, 2016 12:53
@timse timse force-pushed the add-named-exports-option branch from ac2694b to 6e16ce9 Compare September 19, 2016 15:20
Copy link

@unstubbable unstubbable left a 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:

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:

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.
Copy link

@unstubbable unstubbable Sep 23, 2016

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:
Copy link

@unstubbable unstubbable Sep 23, 2016

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

Copy link
Contributor Author

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

@timse timse force-pushed the add-named-exports-option branch from cf328d7 to bc77b55 Compare September 23, 2016 09:47
@timse timse merged commit bf809cb into master Sep 23, 2016
@timse timse deleted the add-named-exports-option branch September 23, 2016 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants