0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

fix(vue): compiler fallback (#13251)

* fix(vue): compiler fallback

* Update index.ts
This commit is contained in:
Florian Lefebvre 2025-02-14 16:24:52 +01:00 committed by GitHub
parent 1c941ee2ad
commit 3842ce5ec9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/vue': patch
---
Fixes a case where the compiler could not be resolved automatically

View file

@ -106,7 +106,7 @@ async function getViteConfiguration(
command: HookParameters<'astro:config:setup'>['command'],
options?: Options,
): Promise<UserConfig> {
let vueOptions = {
const vueOptions = {
...options,
template: {
...options?.template,
@ -114,6 +114,9 @@ async function getViteConfiguration(
},
} satisfies VueOptions;
// The vue vite plugin may not manage to resolve it automatically
vueOptions.compiler ??= await import('vue/compiler-sfc');
const config: UserConfig = {
optimizeDeps: {
// We add `vue` here as `@vitejs/plugin-vue` doesn't add it and we want to prevent