Skip to content

Commit

Permalink
build(ssr): added check object and return stubbedExports with obj
Browse files Browse the repository at this point in the history
  • Loading branch information
egordidenko committed Sep 2, 2024
1 parent f928e6a commit 990b561
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build-ssr-stubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const stubbedExports = Object.fromEntries(
newValue = '() => {}';
} else if (typeof value === 'string') {
newValue = `\`${value}\``;
} else if (typeof value === 'object') {
newValue = JSON.stringify(value);
} else {
throw new Error(`Unexpected export type: ${typeof value}`);
}
Expand Down

0 comments on commit 990b561

Please sign in to comment.