fs-monkey icon indicating copy to clipboard operation
fs-monkey copied to clipboard

Support of package.json subpath exports

Open andrey-ivlev-qs opened this issue 7 months ago • 0 comments

More and more packages moving to ESM format and start using package subpath exports like this (example from lingui lib)

{
  "name": "@lingui/cli",
  "exports": {
    "./api": {
      "types": "./dist/api/index.d.ts",
      "default": "./dist/api/index.js"
    },
    "./api/extractors/typescript": {
      "types": "./dist/api/extractors/typescript.d.ts",
      "default": "./dist/api/extractors/typescript.js"
    }
  },
}

And FS Monkey is unable to resolve require calls like require('@lingui/cli/api').

Specification is stable since node 14

v20 docs: https://nodejs.org/docs/latest-v20.x/api/packages.html#subpath-exports see also #378 (same issue with partial solution)

andrey-ivlev-qs avatar May 23 '25 11:05 andrey-ivlev-qs