diff options
author | 2022-06-27 17:20:28 -0400 | |
---|---|---|
committer | 2022-06-27 17:20:28 -0400 | |
commit | 4acd245d8f59871eb9c0083ae1a0fe7aa70c84f5 (patch) | |
tree | 1ae08bb6c7014521175bacdb7437673e56321d8c /packages/integrations/netlify/src/integration-edge-functions.ts | |
parent | 701799c6d68bc48b75a13e64ffff6f51dc4f4858 (diff) | |
download | astro-4acd245d8f59871eb9c0083ae1a0fe7aa70c84f5.tar.gz astro-4acd245d8f59871eb9c0083ae1a0fe7aa70c84f5.tar.zst astro-4acd245d8f59871eb9c0083ae1a0fe7aa70c84f5.zip |
Refactor: remove Deno shim to esbuild "banner" (#3734)
* refactor: remove Deno shim to esbuild "banner"
* refactor: move shim to const
* refactor: add shim to netlify edge
* chore: changeset
Diffstat (limited to 'packages/integrations/netlify/src/integration-edge-functions.ts')
-rw-r--r-- | packages/integrations/netlify/src/integration-edge-functions.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index 72788abaf..17eaf8350 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -6,6 +6,11 @@ import { fileURLToPath } from 'url'; import type { Plugin as VitePlugin } from 'vite'; import { createRedirects } from './shared.js'; +const SHIM = `globalThis.process = { + argv: [], + env: {}, +};`; + export function getAdapter(): AstroAdapter { return { name: '@astrojs/netlify/edge-functions', @@ -78,6 +83,9 @@ async function bundleServerEntry(buildConfig: BuildConfig, vite: any) { 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. |