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