Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin): avoid duplicate import (#2640) #2897

Merged
merged 3 commits into from Apr 22, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'`,
patak-dev marked this conversation as resolved.
Show resolved Hide resolved
`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