Skip to content

Commit

Permalink
fix(core): resolve symbolic links (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabetti1720 authored Mar 8, 2025
1 parent 063e059 commit e4d51e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions llrt_core/src/module_loader/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ pub fn require_resolve<'a>(
y: &str,
is_esm: bool,
) -> Result<Cow<'a, str>> {
// resolve symlink
let y = if let Ok(path) = Path::new(y).read_link() {
if path.is_absolute() {
path.to_string_lossy().to_string()
} else {
[y, "/../", path.to_string_lossy().as_ref()].concat()
}
} else {
y.to_string()
};
let y = y.as_str();

trace!("require_resolve(x, y):({}, {})", x, y);

// 1'. If X is a bytecode cache,
Expand Down

0 comments on commit e4d51e3

Please sign in to comment.