diff --git a/.changeset/soft-mayflies-warn.md b/.changeset/soft-mayflies-warn.md new file mode 100644 index 000000000..0031f6b46 --- /dev/null +++ b/.changeset/soft-mayflies-warn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes bug with astro/components not loading in the next release diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 76f1c11b5..d7aaec990 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -25,6 +25,9 @@ const ALWAYS_EXTERNAL = new Set([ 'unified', 'whatwg-url', ]); +const ALWAYS_NOEXTERNAL = new Set([ + 'astro', // This is only because Vite's native ESM doesn't resolve "exports" correctly. +]); // note: ssr is still an experimental API hence the type omission export type ViteConfigWithSSR = vite.InlineConfig & { ssr?: { external?: string[]; noExternal?: string[] } }; @@ -69,7 +72,7 @@ export async function createVite(inlineConfig: ViteConfigWithSSR, { astroConfig, // Note: SSR API is in beta (https://vitejs.dev/guide/ssr.html) ssr: { external: [...ALWAYS_EXTERNAL], - noExternal: [], + noExternal: [...ALWAYS_NOEXTERNAL], }, };