fix: remove astro from noExternal

This commit is contained in:
Nate Moore 2021-12-14 15:16:50 -06:00
parent ec6c6169dc
commit 3d7c4b0247

View file

@ -19,7 +19,6 @@ const ALWAYS_EXTERNAL = new Set([
...builtinModules.map((name) => `node:${name}`),
'@sveltejs/vite-plugin-svelte',
'@proload/core',
require.resolve('@proload/core'),
'@babel/core',
'babel-plugin-module-resolver',
'serialize-javascript',
@ -31,9 +30,6 @@ 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[] } };
@ -76,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: [...ALWAYS_NOEXTERNAL],
noExternal: [],
},
};