Skip to content

Commit bafa0ad

Browse files
committed
chore: dont append compat code to dts files
1 parent c022ae7 commit bafa0ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/plugin-react/tsdown.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ export default defineConfig({
1414
],
1515
outputOptions(outputOpts, format) {
1616
if (format === 'cjs') {
17-
outputOpts.footer = 'module.exports.default = module.exports'
17+
outputOpts.footer = (chunk) => {
18+
// don't append to dts files
19+
if (chunk.fileName.endsWith('.cjs')) {
20+
return 'module.exports.default = module.exports'
21+
}
22+
return ''
23+
}
1824
}
1925
return outputOpts
2026
},

0 commit comments

Comments
 (0)