summaryrefslogtreecommitdiff
path: root/ext/node/module_es_shim.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-02-10 12:40:45 +0100
committerGitHub <noreply@github.com>2023-02-10 11:40:45 +0000
commited3a7ce2f719e64e59cfebb3d131a05a1694523b (patch)
treea355c3a0f17ec7dfb8bcdba964deb8dd241b6734 /ext/node/module_es_shim.js
parent9ea899afa76949d2e1a2a6eabbbec14f139a7592 (diff)
refactor: allow to provide polyfills for Node modules from the snapshot (#17706)
This commit does preparatory work to allow snapshotting Node.js compatibility layer, that currently lives in `std/node`. The logic was changed to allow loading some modules from the snapshot and some from the remote URL. Additionally "module_es_shim.js" that provides exports for "node:module" is now snapshotted.
Diffstat (limited to 'ext/node/module_es_shim.js')
-rw-r--r--ext/node/module_es_shim.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/module_es_shim.js b/ext/node/module_es_shim.js
index f32006b4a..2b7c20e26 100644
--- a/ext/node/module_es_shim.js
+++ b/ext/node/module_es_shim.js
@@ -1,6 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-const m = Deno[Deno.internal].require.Module;
+const internals = globalThis.__bootstrap.internals;
+const m = internals.require.Module;
export const _cache = m._cache;
export const _extensions = m._extensions;
export const _findPath = m._findPath;