You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg.exports["."].types types is an invalid format when resolving with the "import" condition. Consider splitting out two types conditions for import and require, and use the .mts extension, e.g. pkg.exports["."].import.types: "./src/types.d.mts"
Yeah it is invalid. When TypeScript tries to resolve the types for import 'my-lib', it will first see "types": "./src/types.d.ts" and use that as it matches all the criteria. It won't use the "types" in "import" (Exports conditions are order-sensitive)
A fix is to move "types": "./src/types.d.ts" after the "import" condition, so the "types" within the "import" condition gets the chance to match first.
I may be wrong and this is necessary, but I've seen the second setup in a popular open source library - is it invalid or not?
"All good!"
Warning
The text was updated successfully, but these errors were encountered: