Skip to content

Commit

Permalink
fix(plugin-vue): avoid duplicate import, fix vitejs#2640 (vitejs#2897)
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 authored and TobiasMelen committed May 3, 2021
1 parent a8a22c3 commit 74b252e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-vue/src/main.ts
Expand Up @@ -143,10 +143,10 @@ export async function transformMain(
// SSR module registration by wrapping user setup
if (ssr) {
output.push(
`import { useSSRContext } from 'vue'`,
`import { useSSRContext as __vite_useSSRContext } from 'vue'`,
`const _sfc_setup = _sfc_main.setup`,
`_sfc_main.setup = (props, ctx) => {`,
` const ssrContext = useSSRContext()`,
` const ssrContext = __vite_useSSRContext()`,
` ;(ssrContext.modules || (ssrContext.modules = new Set())).add(${JSON.stringify(
filename
)})`,
Expand Down

0 comments on commit 74b252e

Please sign in to comment.