-
Notifications
You must be signed in to change notification settings - Fork 72
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
Pattern vs prefix matching #232
Comments
For further reference here:
As @jkrems describes we found for Node.js that because Personally I would like us to encourage package authors to define the "exports" field in Node.js (which is designed to integrate with import maps) such that packages dont use extensions when doing So this is all implementation feedback from implementing trailing |
I agree hat the node js pattern implementation seems much more flexible: {
"imports": {
"./features/*": "./dist/features/*.js"
}
} What's unfortunate now is that import maps and node js export maps now different behavior. |
Node has been experimenting with remapping bare specifiers and started with the same model as import-maps: Exact match and prefix match. What we discovered was that for some (many?) use cases of prefix matching, a more useful model was limited pattern matching. It's gotten to the point where node is looking to deprecate the prefix matching support.
What we replaced it with is still prefix matching: Only
some/bare/*
is supported which applies to the same specifiers thatsome/bare/
would've applied to. The difference is in the RHS which allows to specify where the postfix appears in the resulting URL.It's fairly late into the process for import maps but I thought it may be good to raise this before it's potentially to late to revise how prefix matches work in import maps.
The text was updated successfully, but these errors were encountered: