From 55362452a8eb6abaf74d704cb4333dfc1f0cfe58 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 29 Jun 2023 22:07:05 +0100 Subject: fix(core): consistent extension source resolution (#19615) Currently the resolution for extension sources is different depending on whether `include_js_files_for_snapshotting` is enabled. If sources are embedded it uses `include_str!()` which is module-relative. If sources are read at runtime paths are joined to `CARGO_MANIFEST_DIR` and are package-relative. This makes them both package-relative. Fixes `cargo run -p deno_runtime --example extension_with_esm --features include_js_files_for_snapshotting`. --- runtime/examples/extension_with_esm/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/examples/extension_with_esm') diff --git a/runtime/examples/extension_with_esm/main.rs b/runtime/examples/extension_with_esm/main.rs index 6b21460a3..f8efdbe2f 100644 --- a/runtime/examples/extension_with_esm/main.rs +++ b/runtime/examples/extension_with_esm/main.rs @@ -13,7 +13,7 @@ use deno_runtime::worker::WorkerOptions; deno_core::extension!( hello_runtime, esm_entry_point = "ext:hello_runtime/bootstrap.js", - esm = ["bootstrap.js"] + esm = [dir "examples/extension_with_esm", "bootstrap.js"] ); #[tokio::main] -- cgit v1.2.3