Skip to content

Commit ab793c4

Browse files
committed
feat: export named classes and C
BREAKING CHANGE: Export class list as `clasess` and shorthand `C` named export.
1 parent 50880d3 commit ab793c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,16 @@ export default function thunder(input: Options = {}): Plugin {
8787
: `export default ${rawCode};`;
8888

8989
if (options.cssModules) {
90+
code += "let classes = {};";
9091
code += Object.entries(res.exports ?? {})
9192
.map(
9293
([key, exp]) =>
93-
`export const ${dashesCamelCase(key)} = ${JSON.stringify(
94+
`classes["${dashesCamelCase(key)}"] = ${JSON.stringify(
9495
[exp.name, ...exp.composes.map(({ name }) => name)].join(" "),
9596
)};`,
9697
)
9798
.join("");
99+
code += `export { classes, classes as C };`;
98100
}
99101

100102
return {

0 commit comments

Comments
 (0)