Skip to content

Commit 22f02f2

Browse files
committed
chore: dont append compat code to dts files
1 parent 8fc5acc commit 22f02f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/plugin-react-swc/tsdown.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ export default defineConfig({
2323
],
2424
outputOptions(outputOpts, format) {
2525
if (format === 'cjs') {
26-
outputOpts.footer = 'module.exports.default = module.exports'
26+
outputOpts.footer = (chunk) => {
27+
// don't append to dts files
28+
if (chunk.fileName.endsWith('.cjs')) {
29+
return 'module.exports.default = module.exports'
30+
}
31+
return ''
32+
}
2733
}
2834
return outputOpts
2935
},

0 commit comments

Comments
 (0)