From 903ed31b2aed94a716e2b6db0e9f72b5245dc5a7 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 8 Apr 2024 14:38:59 +0800 Subject: [PATCH] Fix vue-jsx change (#10716) --- packages/integrations/vue/src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/integrations/vue/src/index.ts b/packages/integrations/vue/src/index.ts index f2efc102bc..3604b6d644 100644 --- a/packages/integrations/vue/src/index.ts +++ b/packages/integrations/vue/src/index.ts @@ -19,6 +19,14 @@ function getRenderer(): AstroRenderer { }; } +function getJsxRenderer(): AstroRenderer { + return { + name: '@astrojs/vue (jsx)', + clientEntrypoint: '@astrojs/vue/client.js', + serverEntrypoint: '@astrojs/vue/server.js', + }; +} + function virtualAppEntrypoint(options?: Options): Plugin { const virtualModuleId = 'virtual:@astrojs/vue/app'; const resolvedVirtualModuleId = '\0' + virtualModuleId; @@ -120,6 +128,9 @@ export default function (options?: Options): AstroIntegration { hooks: { 'astro:config:setup': async ({ addRenderer, updateConfig }) => { addRenderer(getRenderer()); + if (options?.jsx) { + addRenderer(getJsxRenderer()); + } updateConfig({ vite: await getViteConfiguration(options) }); }, },