Skip to content

Commit 5c23694

Browse files
committed
fix: export default module.exports
1 parent f3dac60 commit 5c23694

File tree

1 file changed

+3
-1
lines changed
  • packages/plugin-rsc/src/plugins

1 file changed

+3
-1
lines changed

packages/plugin-rsc/src/plugins/cjs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export function cjsModuleRunnerPlugin(): Plugin[] {
6060
// TODO: can we use cjs-module-lexer to properly define named exports?
6161
// for re-exports, we need to eagerly transform dependencies though.
6262
// https://github.com/nodejs/node/blob/f3adc11e37b8bfaaa026ea85c1cf22e3a0e29ae9/lib/internal/modules/esm/translators.js#L382-L409
63-
output.append(`__vite_ssr_exportAll__(module.exports)`)
63+
output.append(
64+
`\n;__vite_ssr_exportAll__(module.exports);\nexport default module.exports;\n`,
65+
)
6466
return {
6567
code: output.toString(),
6668
map: output.generateMap({ hires: 'boundary' }),

0 commit comments

Comments
 (0)