Skip to content

Commit

Permalink
fix: ssr bug with default exports (#3602)
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Jul 21, 2021
1 parent 0dd7124 commit 91da2b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-bulldogs-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'snowpack': patch
---

Fix a small SSR bug with default exports
2 changes: 1 addition & 1 deletion snowpack/src/ssr-loader/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function transform(data) {
}

if (node.type === 'ExportDefaultDeclaration') {
code.overwrite(node.start, node.declaration.start, `${exports}.default = `);
code.overwrite(node.start, node.declaration.start - 1, `${exports}.default = `);
}

if (node.type === 'ExportNamedDeclaration') {
Expand Down

1 comment on commit 91da2b6

@vercel
Copy link

@vercel vercel bot commented on 91da2b6 Jul 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.