jest: [Bug]: Resolve imports field

Version

29.3.1

Steps to reproduce

The package @okikio/resolve.imports used in https://github.com/facebook/jest/pull/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:

https://github.com/facebook/jest/issues/9430#issuecomment-1368484967 https://github.com/lukeed/resolve.exports/issues/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

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Sure, working on exactly that. 😃 Will be ready in about 10 mins