Skip to content

Commit

Permalink
Fix vercel edge private env vars (#6841)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Apr 14, 2023
1 parent 8d2c194 commit e94da01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/integrations/vercel/src/edge/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit e94da01

Please sign in to comment.