For example:
#349 did this incorrectly; types needs to appear first if the intent is to share it between the two other conditions, like:
"exports": {
".": {
"types": "./lib/index.d.ts"
"import": "./lib/index.mjs",
"require": "./lib/index.js"
}
},
The only reason it "works" in the existing case is because TS matches require, finds the .js, then looks for .d.ts next to it, and that works. But for import, it finds .mjs, then looks for .d.mts next to it, and finds nothing, so fails.
For example:
#349 did this incorrectly;
typesneeds to appear first if the intent is to share it between the two other conditions, like:The only reason it "works" in the existing case is because TS matches
require, finds the.js, then looks for.d.tsnext to it, and that works. But forimport, it finds.mjs, then looks for.d.mtsnext to it, and finds nothing, so fails.