diff --git a/.changeset/funny-poets-walk.md b/.changeset/funny-poets-walk.md new file mode 100644 index 000000000..249aa23cc --- /dev/null +++ b/.changeset/funny-poets-walk.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Update default `vite.optimizeDeps.exclude` to keep `node-fetch` from being optimized diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 728d11d0a..8cc0cae2f 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -55,6 +55,7 @@ export async function createVite( logLevel: 'warn', // log warnings and errors only optimizeDeps: { entries: ['src/**/*'], // Try and scan a user’s project (won’t catch everything), + exclude: ['node-fetch'], }, plugins: [ configAliasVitePlugin({ config: astroConfig }),