Skip to content

Commit

Permalink
fix: export all named CJS exports, if default export is a function (#…
Browse files Browse the repository at this point in the history
…2435)

* fix: export all named CJS exports, if default export is a function

* chore: skip arrays when exporting named exports
  • Loading branch information
sheremet-va committed Dec 5, 2022
1 parent ce93195 commit d43f3f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite-node/src/client.ts
Expand Up @@ -425,7 +425,7 @@ function exportAll(exports: any, sourceModule: any) {
if (exports === sourceModule)
return

if (typeof sourceModule !== 'object' || Array.isArray(sourceModule) || !sourceModule)
if (isPrimitive(sourceModule) || Array.isArray(sourceModule))
return

for (const key in sourceModule) {
Expand Down

0 comments on commit d43f3f5

Please sign in to comment.