Skip to content

Commit

Permalink
fix(plugin-vue): avoid duplicate import, fix #2640 (#2897)
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Apr 22, 2021
1 parent 69b9af0 commit 011438d
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 011438d

Please sign in to comment.