Skip to content

Commit d43f3f5

Browse files
authoredDec 5, 2022
fix: export all named CJS exports, if default export is a function (#2435)
* fix: export all named CJS exports, if default export is a function * chore: skip arrays when exporting named exports
1 parent ce93195 commit d43f3f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/vite-node/src/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function exportAll(exports: any, sourceModule: any) {
425425
if (exports === sourceModule)
426426
return
427427

428-
if (typeof sourceModule !== 'object' || Array.isArray(sourceModule) || !sourceModule)
428+
if (isPrimitive(sourceModule) || Array.isArray(sourceModule))
429429
return
430430

431431
for (const key in sourceModule) {

0 commit comments

Comments
 (0)
Please sign in to comment.