Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 2, 2021
1 parent 17014d0 commit 5f72011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/ssr/ssrTransform.ts
Expand Up @@ -129,7 +129,7 @@ export async function ssrTransform(
// export default function foo() {}
// export default class A {}
const { name } = node.declaration.id
s.remove(node.start, node.start + `export default `.length)
s.remove(node.start, node.start + 15 /* 'export default '.length */)
s.append(
`\nObject.defineProperty(${ssrModuleExportsKey}, "default", ` +
`{ enumerable: true, value: ${name} })`
Expand All @@ -138,7 +138,7 @@ export async function ssrTransform(
// anonymous default exports
s.overwrite(
node.start,
node.start + `export default`.length,
node.start + 14 /* 'export default'.length */,
`${ssrModuleExportsKey}.default =`
)
}
Expand Down

0 comments on commit 5f72011

Please sign in to comment.