0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-03 22:29:08 -05:00

Fix vue-jsx change (#10716)

This commit is contained in:
Bjorn Lu 2024-04-08 14:38:59 +08:00 committed by GitHub
parent 799f6f3f29
commit 903ed31b2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 { function virtualAppEntrypoint(options?: Options): Plugin {
const virtualModuleId = 'virtual:@astrojs/vue/app'; const virtualModuleId = 'virtual:@astrojs/vue/app';
const resolvedVirtualModuleId = '\0' + virtualModuleId; const resolvedVirtualModuleId = '\0' + virtualModuleId;
@ -120,6 +128,9 @@ export default function (options?: Options): AstroIntegration {
hooks: { hooks: {
'astro:config:setup': async ({ addRenderer, updateConfig }) => { 'astro:config:setup': async ({ addRenderer, updateConfig }) => {
addRenderer(getRenderer()); addRenderer(getRenderer());
if (options?.jsx) {
addRenderer(getJsxRenderer());
}
updateConfig({ vite: await getViteConfiguration(options) }); updateConfig({ vite: await getViteConfiguration(options) });
}, },
}, },