Skip to content

[Bug]: Resolve imports field #13707

@unional

Description

@unional

Version

29.3.1

Steps to reproduce

The package @okikio/resolve.imports used in #13705 is based on resolve.exports.

It doesn't work correctly with file extensions. e.g.:

{
  "imports": {
    "./a.js": { /* ... */ }
  }
}

Also, it doesn't work correctly with conditions (also a problem from resolve.exports).

See:

#9430 (comment)
lukeed/resolve.exports#22

Expected behavior

All imports field resolutions should work

see: https://github.com/cyberuni/resolve.imports/blob/main/packages/resolve.imports/ts/index.spec.ts

Actual behavior

there are cases not working correctly.

Additional context

Can use resolve.imports, after I add the case to handle circular case

UPDATE: the spec does not support recursion, so the circular case is not possible.
resolve.imports returns undefined in those cases.

Environment

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions