Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit 44e41b1

Browse files
committed
feat(options): add option to disable camel case conversion
This commit introduces a new option `convertToCamelCase` in the options object. This option allows users to control whether the module name should be converted to camel case or not. By default, this option is set to true.
1 parent a699a48 commit 44e41b1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export type Options = {
1515
* @default true
1616
*/
1717
includeOriginalPath?: boolean;
18+
19+
/*
20+
* Whether to convert the module name to camel case
21+
* @default true
22+
*/
23+
convertToCamelCase?: boolean;
1824
};
1925

2026
export type ResolvedOptions = SetRequired<Options, 'includeOriginalPath'>;

src/utils/css-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function getCssModule({ path, ...rest }: ResolvedModuleImport, opti
9191
for (const [key, value] of Object.entries(_exports)) {
9292
__exports[key] = value.name;
9393
}
94-
const exports = camelcaseKeys(__exports);
94+
const exports = options.convertToCamelCase ? camelcaseKeys(__exports) : __exports;
9595

9696
return { css, exports, path, ...rest };
9797
}

0 commit comments

Comments
 (0)