Closed bounoable closed 1 year ago
That is weird, the "types" parameter on package.json shouldn't handle that already?
It's a bit weird and hidden within the Node docs: https://nodejs.org/api/packages.html#community-conditions-definitions
"types" - can be used by typing systems to resolve the typing file for the given export. This condition should always be included first.
Basically, if a package.json provides an "exports" field, then the root "main", "module", and "types" entries are ignored by TypeScript (with moduleResolution set to "NodeNext").
Without the
types
field,"moduleResolution": "NodeNext"
does not work: