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:
parent
c09dfeaf62
commit
ab99b2ec45
2 changed files with 3 additions and 7 deletions
|
@ -94,7 +94,7 @@ function getAdapter({
|
|||
isSharpCompatible: true,
|
||||
},
|
||||
i18nDomains: 'experimental',
|
||||
envGetSecret: 'experimental',
|
||||
envGetSecret: 'stable',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue