summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-05-11 16:26:01 -0500
committerGravatar GitHub <noreply@github.com> 2022-05-11 15:26:01 -0600
commit43e411eed8308015d517de9a0d1e036dc06d34a0 (patch)
tree80f5bfb2ca332b7add86d287d5bb1c0c847b45a0
parent484b80eb99409b7a486a0d4de899c49e9569e06b (diff)
downloadastro-43e411eed8308015d517de9a0d1e036dc06d34a0.tar.gz
astro-43e411eed8308015d517de9a0d1e036dc06d34a0.tar.zst
astro-43e411eed8308015d517de9a0d1e036dc06d34a0.zip
Exclude `node-fetch` from vite.optimizeDeps (#3348)
* fix: exclude `node-fetch` from vite.optimizeDeps * chore: format
Diffstat (limited to '')
-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 }),