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:
parent
799f6f3f29
commit
903ed31b2a
1 changed files with 11 additions and 0 deletions
|
@ -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) });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue