diff options
author | 2024-06-20 18:21:03 +0200 | |
---|---|---|
committer | 2024-06-20 18:21:03 +0200 | |
commit | 4489c34aea9cab96c60763850ecfb2d2c272c162 (patch) | |
tree | 1c5d965edeb9ae105c9aadfb922d39f75dc84ebd /packages/integrations/netlify/src/index.ts | |
parent | bda21bafdf55eddee19593749778b0793b586d11 (diff) | |
download | astro-4489c34aea9cab96c60763850ecfb2d2c272c162.tar.gz astro-4489c34aea9cab96c60763850ecfb2d2c272c162.tar.zst astro-4489c34aea9cab96c60763850ecfb2d2c272c162.zip |
fix(netlify): astro:env getSecret (#293)
Diffstat (limited to 'packages/integrations/netlify/src/index.ts')
-rw-r--r-- | packages/integrations/netlify/src/index.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/integrations/netlify/src/index.ts b/packages/integrations/netlify/src/index.ts index 8485afffb..cd13d9362 100644 --- a/packages/integrations/netlify/src/index.ts +++ b/packages/integrations/netlify/src/index.ts @@ -124,6 +124,16 @@ async function writeNetlifyDeployConfig(config: AstroConfig, logger: AstroIntegr ); } +// TODO: remove once we don't use a TLA anymore +async function shouldExternalizeAstroEnvSetup() { + try { + await import('astro/env/setup'); + return false; + } catch { + return true; + } +} + export interface NetlifyIntegrationConfig { /** * If enabled, On-Demand-Rendered pages are cached for up to a year. @@ -362,6 +372,11 @@ export default function netlifyIntegration( ignored: [fileURLToPath(new URL('./.netlify/**', rootDir))], }, }, + ...((await shouldExternalizeAstroEnvSetup()) + ? { + ssr: { external: ['astro/env/setup'] }, + } + : {}), }, image: { service: { |