diff options
Diffstat (limited to 'packages/integrations/deno/src')
-rw-r--r-- | packages/integrations/deno/src/index.ts | 8 | ||||
-rw-r--r-- | packages/integrations/deno/src/server.ts | 5 | ||||
-rw-r--r-- | packages/integrations/deno/src/shim.ts | 5 |
3 files changed, 8 insertions, 10 deletions
diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index 0dad8e8ef..a104ba863 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -9,6 +9,11 @@ interface Options { hostname?: string; } +const SHIM = `globalThis.process = { + argv: [], + env: Deno.env.toObject(), +};` + export function getAdapter(args?: Options): AstroAdapter { return { name: '@astrojs/deno', @@ -63,6 +68,9 @@ export default function createIntegration(args?: Options): AstroIntegration { format: 'esm', bundle: true, external: ['@astrojs/markdown-remark'], + banner: { + js: SHIM, + } }); // Remove chunks, if they exist. Since we have bundled via esbuild these chunks are trash. diff --git a/packages/integrations/deno/src/server.ts b/packages/integrations/deno/src/server.ts index 9d2fc98a9..f6dbcb62c 100644 --- a/packages/integrations/deno/src/server.ts +++ b/packages/integrations/deno/src/server.ts @@ -1,8 +1,3 @@ -// NOTE(fks): Side-effect -- shim.js must run first. This isn't guaranteed by -// the language, but it is a Node.js behavior that we rely on here. Keep this -// separate from the other imports so that it doesn't get organized & reordered. -import './shim.js'; - // Normal Imports import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; diff --git a/packages/integrations/deno/src/shim.ts b/packages/integrations/deno/src/shim.ts deleted file mode 100644 index 62e82ba30..000000000 --- a/packages/integrations/deno/src/shim.ts +++ /dev/null @@ -1,5 +0,0 @@ -(globalThis as any).process = { - argv: [], - // @ts-ignore - env: Deno.env.toObject(), -}; |