0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Use noExternal config on 'astro' (#2570)

* Use noExternal config on 'astro'

* Changeset
This commit is contained in:
Matthew Phillips 2022-02-11 16:22:16 -05:00 committed by GitHub
parent ba54e014e1
commit 34317bc05c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes bug with astro/components not loading in the next release

View file

@ -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],
},
};