Skip to content

Conversation

@eldiablolives
Copy link

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.

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": { ".": ... }
Copy link
Member

@HerrCai0907 HerrCai0907 left a 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
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants