diff options
author | 2024-06-14 16:29:53 -0400 | |
---|---|---|
committer | 2024-06-14 16:29:53 -0400 | |
commit | 7eb4ddaa6db1d944d6d7a185dc94ea3c0f3f9c95 (patch) | |
tree | 3ff0fe5fc850e88ae55ded54efa5519b3d0816e6 /packages/integrations/node/src | |
parent | 7ba13c772df1c457e145afdd6faea90c2c1d2ed5 (diff) | |
download | astro-7eb4ddaa6db1d944d6d7a185dc94ea3c0f3f9c95.tar.gz astro-7eb4ddaa6db1d944d6d7a185dc94ea3c0f3f9c95.tar.zst astro-7eb4ddaa6db1d944d6d7a185dc94ea3c0f3f9c95.zip |
Fix backwards compat with Astro <= 4.9 (#11261)
Diffstat (limited to 'packages/integrations/node/src')
-rw-r--r-- | packages/integrations/node/src/server.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/integrations/node/src/server.ts b/packages/integrations/node/src/server.ts index e5b503292..e79c0761a 100644 --- a/packages/integrations/node/src/server.ts +++ b/packages/integrations/node/src/server.ts @@ -5,10 +5,13 @@ import { createStandaloneHandler } from './standalone.js'; import startServer from './standalone.js'; import type { Options } from './types.js'; +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(); |