Skip to content

Commit 011438d

Browse files
authored
fix(plugin-vue): avoid duplicate import, fix #2640 (#2897)
1 parent 69b9af0 commit 011438d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/plugin-vue/src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export async function transformMain(
143143
// SSR module registration by wrapping user setup
144144
if (ssr) {
145145
output.push(
146-
`import { useSSRContext } from 'vue'`,
146+
`import { useSSRContext as __vite_useSSRContext } from 'vue'`,
147147
`const _sfc_setup = _sfc_main.setup`,
148148
`_sfc_main.setup = (props, ctx) => {`,
149-
` const ssrContext = useSSRContext()`,
149+
` const ssrContext = __vite_useSSRContext()`,
150150
` ;(ssrContext.modules || (ssrContext.modules = new Set())).add(${JSON.stringify(
151151
filename
152152
)})`,

0 commit comments

Comments
 (0)