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

feat(next): make astro:env stable (#11679)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
This commit is contained in:
Florian Lefebvre 2024-08-21 08:38:00 +02:00 committed by GitHub
parent c09dfeaf62
commit ab99b2ec45
2 changed files with 3 additions and 7 deletions

View file

@ -94,7 +94,7 @@ function getAdapter({
isSharpCompatible: true,
},
i18nDomains: 'experimental',
envGetSecret: 'experimental',
envGetSecret: 'stable',
},
};
}

View file

@ -1,6 +1,7 @@
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { SSRManifest } from 'astro';
import { NodeApp, applyPolyfills } from 'astro/app/node';
import { setGetEnv } from 'astro/env/setup';
import {
ASTRO_LOCALS_HEADER,
ASTRO_MIDDLEWARE_SECRET_HEADER,
@ -10,12 +11,7 @@ import {
// Run polyfills immediately so any dependent code can use the globals
applyPolyfills();
// 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(() => {});
setGetEnv((key) => process.env[key]);
export const createExports = (
manifest: SSRManifest,