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:
parent
ba54e014e1
commit
34317bc05c
2 changed files with 9 additions and 1 deletions
5
.changeset/soft-mayflies-warn.md
Normal file
5
.changeset/soft-mayflies-warn.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes bug with astro/components not loading in the next release
|
|
@ -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],
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue