guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
912 stars 47 forks source link

Adding `types` entry to exports map. #134

Closed dzearing closed 1 year ago

dzearing commented 1 year ago

When using this package in a TypeScript environment which uses moduleResolution: 'nodenext', TypeScript won't find the typings unless the exports map entries include a types key. (E.g. it ignores the one at root.)

Another remedy is to include typings right next to the source. I believe TypeScript will find them this way as well.

Tested locally by adding this entry made TS happy. :)

guybedford commented 1 year ago

Thanks for the PR!