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:
parent
1c941ee2ad
commit
3842ce5ec9
2 changed files with 9 additions and 1 deletions
5
.changeset/itchy-buckets-dream.md
Normal file
5
.changeset/itchy-buckets-dream.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/vue': patch
|
||||
---
|
||||
|
||||
Fixes a case where the compiler could not be resolved automatically
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue