Fix vercel edge private env vars (#6841)
This commit is contained in:
parent
00a2e1d7c7
commit
2e3125e180
2 changed files with 12 additions and 0 deletions
5
.changeset/blue-moons-cough.md
Normal file
5
.changeset/blue-moons-cough.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/vercel': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix vercel edge private environment variables usage
|
|
@ -85,6 +85,13 @@ export default function vercelEdge({
|
||||||
|
|
||||||
vite.ssr ||= {};
|
vite.ssr ||= {};
|
||||||
vite.ssr.target ||= 'webworker';
|
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 }) => {
|
'astro:build:done': async ({ routes }) => {
|
||||||
|
|
Loading…
Reference in a new issue