-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
import.meta.resolve with npm packages #21298
Comments
Strictly speaking, the specifier being loaded in the module registry is |
To clarify, the sensible behavior to me is: import.meta.resolve("npm:preact"); // Returns "npm:preact" With this import map: {
"imports": {
"npm:preact": "https://esm.sh/preact"
}
} import.meta.resolve("npm:preact"); // Returns "https://esm.sh/preact" |
I agree. |
Opened denoland/deno_core#354 that will make it easier to customize. |
This commits adds "RuntimeOptions::import_meta_resolve_callback" option that allows to customize behavior of `import.meta.resolve` API. Required for denoland/deno#21298.
Closes #21298. "npm:" specifiers are matched against import map entries and if no match is found they are passed through.
Closes #21298. "npm:" specifiers are matched against import map entries and if no match is found they are passed through.
Related: #16089
Every time I try to resolve a npm package:
I get the error:
I would rather the old behavior, returning simply
npm:preact
. This error is very unfortunated because now it's not possible to get the final specifier if the specifier is mapped in the import map:I guess this is the intended behavior would like to know the explanation for that decision.
The text was updated successfully, but these errors were encountered: