|
1 | 1 | // NOTE: This is a fragment of a JavaScript program that will be inlined with |
2 | 2 | // a Webpack bundle. You should not import this file from anywhere in the |
3 | 3 | // application. |
4 | | -import { AsyncLocalStorage } from 'node:async_hooks' |
5 | | - |
6 | 4 | import { createRequire } from 'node:module' // used in dynamically generated part |
7 | | -import process from 'node:process' |
8 | 5 |
|
9 | 6 | import { registerCJSModules } from '../edge-runtime/lib/cjs.ts' // used in dynamically generated part |
10 | 7 |
|
11 | | -globalThis.process = process |
| 8 | +if (typeof process === 'undefined') { |
| 9 | + globalThis.process = (await import('node:process')).default |
| 10 | +} |
| 11 | + |
| 12 | +if (typeof AsyncLocalStorage === 'undefined') { |
| 13 | + globalThis.AsyncLocalStorage = (await import('node:async_hooks')).AsyncLocalStorage |
| 14 | +} |
12 | 15 |
|
13 | | -globalThis.AsyncLocalStorage = AsyncLocalStorage |
| 16 | +if (typeof Buffer === 'undefined') { |
| 17 | + globalThis.Buffer = (await import('node:buffer')).Buffer |
| 18 | +} |
14 | 19 |
|
15 | 20 | // needed for path.relative and path.resolve to work |
16 | 21 | Deno.cwd = () => '' |
0 commit comments