summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 36f9718b5..2dde5a369 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -4,7 +4,6 @@ use crate::inspector_server::InspectorServer;
use crate::ops;
use crate::permissions::PermissionsContainer;
use crate::tokio_util::create_and_run_current_thread;
-use crate::worker::init_runtime_module_map;
use crate::worker::FormatJsErrorFn;
use crate::BootstrapOptions;
use deno_broadcast_channel::InMemoryBroadcastChannel;
@@ -485,6 +484,15 @@ impl WebWorker {
let startup_snapshot = options.startup_snapshot
.expect("deno_runtime startup snapshot is not available with 'create_runtime_snapshot' Cargo feature.");
+ // Clear extension modules from the module map, except preserve `ext:deno_node`
+ // modules as `node:` specifiers.
+ let rename_modules = Some(
+ deno_node::SUPPORTED_BUILTIN_NODE_MODULES
+ .iter()
+ .map(|p| (p.ext_specifier, p.specifier))
+ .collect(),
+ );
+
let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()),
startup_snapshot: Some(startup_snapshot),
@@ -494,9 +502,9 @@ impl WebWorker {
compiled_wasm_module_store: options.compiled_wasm_module_store.clone(),
extensions,
inspector: options.maybe_inspector_server.is_some(),
+ rename_modules,
..Default::default()
});
- init_runtime_module_map(&mut js_runtime);
if let Some(server) = options.maybe_inspector_server.clone() {
server.register_inspector(