diff --git a/.changeset/wise-bulldogs-sin.md b/.changeset/wise-bulldogs-sin.md new file mode 100644 index 0000000000..045365a5cd --- /dev/null +++ b/.changeset/wise-bulldogs-sin.md @@ -0,0 +1,5 @@ +--- +'snowpack': patch +--- + +Fix a small SSR bug with default exports diff --git a/snowpack/src/ssr-loader/transform.ts b/snowpack/src/ssr-loader/transform.ts index cbe9b0ed4e..d23d5a5df4 100644 --- a/snowpack/src/ssr-loader/transform.ts +++ b/snowpack/src/ssr-loader/transform.ts @@ -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') {