-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add ~
and /
support to the glob resolver
#9188
Conversation
Thanks for the PR. Absolute and tilde specifiers in Parcel have a different meaning. See the docs here: https://parceljs.org/features/dependency-resolution/#absolute-specifiers. I guess if we add support in the glob resolver they should match the default resolver as well, so absolute should resolve to the project root and tilde should resolve to the nearest node_modules root or project root. I'm curious about your use case for system-level absolute/tilde paths. We haven't supported that because paths outside of the project are generally not portable between machines. |
Ohh, I totally misunderstood that issue! I didn't realize Parcel had special meanings for those identifiers. I just assumed they were system level and there was a good reason for needing it. I don't actually have a use case here. Just trying to knock off some "help wanted" issues to get comfortable contributing. I'll rework the PR to properly support the Parcel path semantics. Thanks for the feedback! |
@devongovett I fixed this one up whenever you have a chance to take a look again. Sorry about the initial mixup! |
~
home and absolute path support to the glob resolver~
and /
support to the glob resolver
Thank you @mischnic for cleaning this one up! My apologies for not getting to it :( |
↪️ Pull Request
Fixes #8704 by adding support for
~
and absolute paths with the glob resolver.~
resolves to the nearest package boundary and/
to the project root.💻 Examples
This allows folks using the glob resolver to import globs like:
import images from '~/images/*.png
(package boundary)import images from '/dir/images/*.png'
(project root)🚨 Test instructions
I included integration tests that cover this feature.
✔️ PR Todo