-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Extract resolution algorithm for imports
#14
Comments
There are a couple additions to the There's also #6 to consider, which would mean that there'd have to be different error codes thrown. Still planned for a 2.0 release |
Awesome, looking forward to it! Very close to shipping |
Create a package import { resolve, legacy } from 'resolve.pkg'
import { resolve, legacy, resolveExports, resolveImports } from 'resolve.pkg'
// type default 'exports'
resolve(pkgJSON, './foo', {type: 'exports'}) // === resolve(pkgJSON, './foo') === resolveExports(pkgJSON)
resolve(pkgJSON, '#dep', {type: 'imports'}) // === resolveImports(pkgJSON, '#dep') Add some necessary validation That's my advice |
Should not need the type argument, can be checked by # start, |
If y'all need a quick |
Jest 28 is out with exports support. Very happy with the integration! 😀 Is imports still on the roadmap @lukeed? |
Is this published on npm anywhere by any chance? 🙂 Found myself needing to resolve imports, and was hoping this package already supported it @lukeed would you be open for a contribution to support this usecase? |
I could quickly publish it as a package if you'd like. |
That'd be awesome, thanks 🙂 |
@thepassle It's published as You can also use, it seems to be an alternative |
Thanks dude, appreciate it! |
Yeah, thanks! I just opened a PR in Jest using it 🙂 |
As an aside, I opened up nodejs/node#44535 in node core asking then to expose the algorithm for others to use. Not much movement yet, but who knows 🙂 |
FYI resolve.imports 1.2.4 is released. |
|
From what I understand, the
imports
field has the same rules when it comes to conditions and wildcard substitutions thatexports
has. Do you have any plans to extract the algorithm used in this module so it can be reused forimports
? Or create anresolve.imports
module? 😀The text was updated successfully, but these errors were encountered: