Skip to content

Commit a7f0af7

Browse files
mrmckeblianapache
andauthored
feat: add opt-out for named exports (#132)
Co-authored-by: Roksolana Yasynevych <[email protected]>
1 parent d73e5a4 commit a7f0af7

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Please note that no options are required. However, depending on your configurati
103103
| `customMatcher` | `"\\.module\\.(c\|le\|sa\|sc)ss$"` | Changes the file extensions that this plugin processes. |
104104
| `customRenderer` | `false` | See [`customRenderer`](#customRenderer) below. |
105105
| `customTemplate` | `false` | See [`customTemplate`](#customTemplate) below. |
106+
| `namedExports` | `true` | Enables named exports for compatible classnames. |
106107
| `dotenvOptions` | `{}` | Provides options for [`dotenv`](https://github.com/motdotla/dotenv#options). |
107108
| `postCssOptions` | `{}` | See [`postCssOptions`](#postCssOptions) below. |
108109
| `rendererOptions` | `{}` | See [`rendererOptions`](#rendererOptions) below. |

src/helpers/createExports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ${processedClasses.map(classNameToProperty).join('\n ')}
4545
export default classes;
4646
`;
4747

48-
if (camelCasedKeys.length) {
48+
if (options.namedExports !== false && camelCasedKeys.length) {
4949
dts += camelCasedKeys.join('\n') + '\n';
5050
}
5151

src/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface Options {
2525
customRenderer?: string;
2626
customTemplate?: string;
2727
dotenvOptions?: DotenvConfigOptions;
28+
namedExports?: boolean;
2829
postCssOptions?: PostCssOptions;
2930
rendererOptions?: RendererOptions;
3031
}

0 commit comments

Comments
 (0)