diff options
Diffstat (limited to 'cli/standalone/mod.rs')
-rw-r--r-- | cli/standalone/mod.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 1df3895ef..e0c8e66ff 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -88,7 +88,7 @@ struct WorkspaceEszipModule { struct WorkspaceEszip { eszip: eszip::EszipV2, - root_dir_url: ModuleSpecifier, + root_dir_url: Arc<ModuleSpecifier>, } impl WorkspaceEszip { @@ -166,6 +166,22 @@ impl ModuleLoader for EmbeddedModuleLoader { self.shared.workspace_resolver.resolve(specifier, &referrer); match mapped_resolution { + Ok(MappedResolution::WorkspaceNpmPackage { + target_pkg_json: pkg_json, + sub_path, + .. + }) => Ok( + self + .shared + .node_resolver + .resolve_package_sub_path_from_deno_module( + pkg_json.dir_path(), + sub_path.as_deref(), + Some(&referrer), + NodeResolutionMode::Execution, + )? + .into_url(), + ), Ok(MappedResolution::PackageJson { dep_result, sub_path, @@ -427,7 +443,8 @@ pub async fn run( let npm_registry_url = ModuleSpecifier::parse("https://localhost/").unwrap(); let root_path = std::env::temp_dir().join(format!("deno-compile-{}", current_exe_name)); - let root_dir_url = ModuleSpecifier::from_directory_path(&root_path).unwrap(); + let root_dir_url = + Arc::new(ModuleSpecifier::from_directory_path(&root_path).unwrap()); let main_module = root_dir_url.join(&metadata.entrypoint_key).unwrap(); let root_node_modules_path = root_path.join("node_modules"); let npm_cache_dir = NpmCacheDir::new( @@ -579,6 +596,7 @@ pub async fn run( }) .collect(); WorkspaceResolver::new_raw( + root_dir_url.clone(), import_map, pkg_jsons, metadata.workspace_resolver.pkg_json_resolution, |