File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,15 @@ export const writeToFile = async (
17
17
) => {
18
18
const typeName = getTypeName ( path . basename ( fileName ) , options )
19
19
let exportTypes = ''
20
+ let namedExports = ''
20
21
const exportStyle = options ?. esmExport
21
22
? 'export default classNames;'
22
23
: 'export = classNames;'
23
24
for ( const classNameKey of classNameKeys . keys ( ) ) {
24
25
exportTypes = `${ exportTypes } \n${ formatExportType ( classNameKey , typeName ) } `
26
+ namedExports = `${ namedExports } \nexport const ${ classNameKey } : '${
27
+ typeName ?? classNameKey
28
+ } ';`
25
29
}
26
30
27
31
let outputFileString = ''
@@ -34,9 +38,9 @@ export const writeToFile = async (
34
38
options . global . outputFilePath
35
39
)
36
40
outputFileString = `import globalClassNames from '${ relativePath } ${ exportTypeFileName } '\n`
37
- outputFileString = `${ outputFileString } declare const classNames: typeof globalClassNames & {${ exportTypes } \n};\n${ exportStyle } `
41
+ outputFileString = `${ outputFileString } \n ${ namedExports } \n\ndeclare const classNames: typeof globalClassNames & {${ exportTypes } \n};\n${ exportStyle } `
38
42
} else {
39
- outputFileString = `declare const classNames: {${ exportTypes } \n};\n${ exportStyle } `
43
+ outputFileString = `${ namedExports } \n\ndeclare const classNames: {${ exportTypes } \n};\n${ exportStyle } `
40
44
}
41
45
42
46
const prettierdOutputFileString = await format (
You can’t perform that action at this time.
0 commit comments