diff options
-rw-r--r-- | .changeset/itchy-buckets-dream.md | 5 | ||||
-rw-r--r-- | packages/integrations/vue/src/index.ts | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/.changeset/itchy-buckets-dream.md b/.changeset/itchy-buckets-dream.md new file mode 100644 index 000000000..3c26324bf --- /dev/null +++ b/.changeset/itchy-buckets-dream.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vue': patch +--- + +Fixes a case where the compiler could not be resolved automatically diff --git a/packages/integrations/vue/src/index.ts b/packages/integrations/vue/src/index.ts index f81167323..66e5d269c 100644 --- a/packages/integrations/vue/src/index.ts +++ b/packages/integrations/vue/src/index.ts @@ -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 |