-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
test: add specs for node loader #4295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add specs for node loader #4295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use https://github.com/kdy1/swc/tree/node-resolver
You can make a PR towards it, if you prefer it
Thanks, |
Tests look good to me. |
close in favour of #4327 |
Description
The goal of this PR is to:
This add the two following spec:
Current issue with relative
Path
When you use
Path
and you are at.
when you ask the parent it will not give you../
resulting in aNone
state.New approach
I do not know if this new approach is the best way to handle it as I'm new with rust.
We are now using absolute path so we can always get the
parent
except when we are at the root, and we are usingpathdiff
(which is used by rust itself rust-lang/rust#67108) to get the relative path with:There are still a lof of unwrap in this first draft, so I might need to do some additional changes
BREAKING CHANGE:
No breaking change in terms of API
Related (if exists):
pathdiff
crate for path_relative_from rust-lang/rust#67108