Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

aliased requests in resolver_context.file_dependencies are not normalized/canonicalized #73

Closed
xc2 opened this issue Feb 3, 2024 · 2 comments · Fixed by #78
Closed
Assignees

Comments

@xc2
Copy link
Contributor

xc2 commented Feb 3, 2024

oxc_resolver: 1.2.0-1.3.0
os: Windows

Summary

let root = dir().join("fixtures\\enhanced_resolve\\test\\fixtures");
let mut ctx = ResolveContext::default();

let resolver = Resolver::new(ResolveOptions {
    alias: vec![(
        "@".into(),
        vec![AliasValue::Path(root.join("alias").to_string_lossy().into())],
    )],
    ..ResolveOptions::default()
});
let _ = resolver.resolve_with_context(root, "@/files/a", &mut ctx);

for d in ctx.file_dependencies.iter() {
    println!("{}", d.to_string_lossy());
}

Expected

C:\Users\imkf\Developer\oxc-resolver\fixtures\enhanced_resolve\test\fixtures\alias\files\a.js seen in output,

Actual

C:\Users\imkf\Developer\oxc-resolver\fixtures\enhanced_resolve\test\fixtures\alias/files/a.js got

Related

web-infra-dev/rspack#5445

@Boshen Boshen self-assigned this Feb 3, 2024
@Boshen
Copy link
Member

Boshen commented Feb 3, 2024

let new_specifier = format!("{alias_value}{tail}");

I don't know how to fix this ... I'll check with enhanced_resolved tomorrow.

@xc2
Copy link
Contributor Author

xc2 commented Feb 4, 2024

thank you

Boshen added a commit that referenced this issue Feb 6, 2024
Boshen added a commit that referenced this issue Feb 6, 2024
@Boshen Boshen closed this as completed in #78 Feb 6, 2024
Boshen added a commit that referenced this issue Feb 6, 2024
* fix: normalize aliased path

closes #73
closes #79

* update
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants