-
-
Notifications
You must be signed in to change notification settings - Fork 682
resolver: support package exports for root import (".") #2971
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
Conversation
Add basic support for the "exports" field in package.json when resolving
bare package imports. Checks "exports["."]" first, then falls back to
existing ascMain and assembly/ behavior.
This enables modern package setups while preserving full compatibility.
Tested with --traceResolution on packages using "exports": { ".": ... }
@HerrCai0907
HerrCai0907
left a comment
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.
I like this concept.
However, could it be possible to limit it under cli/index.js part? I think all module resolving logic is out of src scope.
As requested — keep core src/ logic unchanged, handle modern exports only in CLI package loading path.
eldiablolives
commented
Dec 30, 2025
@HerrCai0907 Thank you for the feedback! I've moved all the package resolution logic to the CLI side only, keeping the core parser unchanged. The module resolving now happens exclusively in index.js during file loading
Closes or improves upon long-standing bare import limitations.
Allows libraries like @whatever/stuff to use standard "exports" mapping.
No breaking changes — full fallback to ascMain/assembly.