diff options
Diffstat (limited to 'ext/node/resolution.rs')
-rw-r--r-- | ext/node/resolution.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index 6e4637286..4c43fcbad 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -534,20 +534,20 @@ impl NodeResolver { let mut searched_for_d_cts = false; if lowercase_path.ends_with(".mjs") { let d_mts_path = with_known_extension(path, "d.mts"); - if fs.exists(&d_mts_path) { + if fs.exists_sync(&d_mts_path) { return Some(d_mts_path); } searched_for_d_mts = true; } else if lowercase_path.ends_with(".cjs") { let d_cts_path = with_known_extension(path, "d.cts"); - if fs.exists(&d_cts_path) { + if fs.exists_sync(&d_cts_path) { return Some(d_cts_path); } searched_for_d_cts = true; } let dts_path = with_known_extension(path, "d.ts"); - if fs.exists(&dts_path) { + if fs.exists_sync(&dts_path) { return Some(dts_path); } @@ -561,7 +561,7 @@ impl NodeResolver { _ => None, // already searched above }; if let Some(specific_dts_path) = specific_dts_path { - if fs.exists(&specific_dts_path) { + if fs.exists_sync(&specific_dts_path) { return Some(specific_dts_path); } } @@ -580,7 +580,7 @@ impl NodeResolver { { return Some(path); } - if self.fs.is_dir(&path) { + if self.fs.is_dir_sync(&path) { let index_path = path.join("index.js"); if let Some(path) = probe_extensions( &*self.fs, @@ -1163,7 +1163,7 @@ impl NodeResolver { ); let mut current_dir = current_dir.as_path(); let package_json_path = current_dir.join("package.json"); - if self.fs.exists(&package_json_path) { + if self.fs.exists_sync(&package_json_path) { return Ok(Some(package_json_path)); } let Some(root_pkg_folder) = self @@ -1174,7 +1174,7 @@ impl NodeResolver { while current_dir.starts_with(&root_pkg_folder) { current_dir = current_dir.parent().unwrap(); let package_json_path = current_dir.join("package.json"); - if self.fs.exists(&package_json_path) { + if self.fs.exists_sync(&package_json_path) { return Ok(Some(package_json_path)); } } @@ -1224,7 +1224,7 @@ impl NodeResolver { if let Some(main) = maybe_main { let guess = package_json.path.parent().unwrap().join(main).clean(); - if self.fs.is_file(&guess) { + if self.fs.is_file_sync(&guess) { return Ok(Some(guess)); } @@ -1253,7 +1253,7 @@ impl NodeResolver { .unwrap() .join(format!("{main}{ending}")) .clean(); - if self.fs.is_file(&guess) { + if self.fs.is_file_sync(&guess) { // TODO(bartlomieju): emitLegacyIndexDeprecation() return Ok(Some(guess)); } @@ -1276,7 +1276,7 @@ impl NodeResolver { .unwrap() .join(index_file_name) .clean(); - if self.fs.is_file(&guess) { + if self.fs.is_file_sync(&guess) { // TODO(bartlomieju): emitLegacyIndexDeprecation() return Ok(Some(guess)); } |