summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/funny-poets-walk.md5
-rw-r--r--packages/astro/src/core/create-vite.ts1
2 files changed, 6 insertions, 0 deletions
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 }),