0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

feat: add support for astro:env to node and vercel (#11199)

This commit is contained in:
Florian Lefebvre 2024-06-10 16:43:48 +02:00 committed by GitHub
parent 3b9ff01794
commit 5654523dd7
3 changed files with 8 additions and 0 deletions

View file

@ -98,6 +98,7 @@ function getAdapter({
isSquooshCompatible: true,
},
i18nDomains: 'experimental',
envGetSecret: 'experimental',
},
};
}

View file

@ -8,6 +8,12 @@ import {
ASTRO_PATH_PARAM,
} from './adapter.js';
// Won't throw if the virtual module is not available because it's not supported in
// the users's astro version or if astro:env is not enabled in the project
await import('astro/env/setup')
.then((mod) => mod.setGetEnv((key) => process.env[key]))
.catch(() => {});
applyPolyfills();
export const createExports = (

View file

@ -32,6 +32,7 @@ function getAdapter(): AstroAdapter {
staticOutput: 'stable',
serverOutput: 'unsupported',
hybridOutput: 'unsupported',
envGetSecret: 'unsupported',
},
adapterFeatures: {
edgeMiddleware: false,