Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaOlejniczak committed Jul 30, 2024
1 parent 12f86ab commit 290ce6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/utils/node-resolver-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,15 @@ impl<'a> ResolveRequest<'a> {
fn resolve_relative(&self, specifier: &Path, from: &Path) -> Result<Resolution, ResolverError> {
// Resolve aliases from the nearest package.json.
let path = resolve_path(from, specifier);
println!("resolved path {}", path.display());
let package = if self.resolver.flags.contains(Flags::ALIASES) {
self.find_package(path.parent().unwrap())?
} else {
None
};

if let Some(res) = self.load_path(&path, package)? {
println!("loaded path {} with {:?}", path.display(), res);
return Ok(res);
}

Expand Down Expand Up @@ -1036,6 +1038,11 @@ impl<'a> ResolveRequest<'a> {

fn try_file_without_aliases(&self, path: &Path) -> Result<Option<Resolution>, ResolverError> {
if self.resolver.cache.is_file(path) {
println!(
"canonicalizing path {}, got {}",
path.display(),
self.resolver.cache.canonicalize(path)?.display()
);
Ok(Some(Resolution::Path(
self.resolver.cache.canonicalize(path)?,
)))
Expand Down
1 change: 0 additions & 1 deletion packages/utils/node-resolver-rs/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ pub fn resolve_path<A: AsRef<Path>, B: AsRef<Path>>(base: A, subpath: B) -> Path
}
}

println!("ret {}", ret.display());
ret
}

0 comments on commit 290ce6d

Please sign in to comment.