diff options
Diffstat (limited to 'packages/integrations/netlify/src/ssr-function.ts')
-rw-r--r-- | packages/integrations/netlify/src/ssr-function.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/integrations/netlify/src/ssr-function.ts b/packages/integrations/netlify/src/ssr-function.ts index dba0dbead..46778ea07 100644 --- a/packages/integrations/netlify/src/ssr-function.ts +++ b/packages/integrations/netlify/src/ssr-function.ts @@ -3,10 +3,13 @@ import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { applyPolyfills } from 'astro/app/node'; +type EnvSetupModule = typeof import('astro/env/setup'); + // 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])) +const setupModule = 'astro/env/setup'; +await import(/* @vite-ignore */ setupModule) + .then((mod: EnvSetupModule) => mod.setGetEnv((key) => process.env[key])) .catch(() => {}); applyPolyfills(); |