summaryrefslogtreecommitdiff
path: root/packages/integrations
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations')
-rw-r--r--packages/integrations/vercel/src/edge/adapter.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/integrations/vercel/src/edge/adapter.ts b/packages/integrations/vercel/src/edge/adapter.ts
index 411717a41..a2e937987 100644
--- a/packages/integrations/vercel/src/edge/adapter.ts
+++ b/packages/integrations/vercel/src/edge/adapter.ts
@@ -85,6 +85,13 @@ export default function vercelEdge({
vite.ssr ||= {};
vite.ssr.target ||= 'webworker';
+
+ // Vercel edge runtime is a special webworker-ish environment that supports process.env,
+ // but Vite would replace away `process.env` in webworkers, so we set a define here to prevent it
+ vite.define = {
+ 'process.env': 'process.env',
+ ...vite.define,
+ };
}
},
'astro:build:done': async ({ routes }) => {