Closed Offroaders123 closed 7 months ago
Oops, I didn't realize that future commits also go towards the pull request, I was only looking to submit the first one. I'm going to look into how to fix that. The other commits were just a few experiments I wanted to try out.
Thanks 😄
Was looking into using this project with my own Minecraft NBT parser, which is built to target ESM TypeScript. I'm not completely certain it was ESM module resolution that specifically caused the issue, but installing this project to my dependencies, TypeScript wasn't able to resolve the types accordingly.
After looking into the syntax that allows dual-packages to define ESM and CJS targets, I thought I'd try this dual-types description type. This indeed fixed the problem, I think it wasn't working before because TypeScript couldn't find type aliases from the
export
key, so maybe it can't usetypes
in conjunction withexports
.https://stackoverflow.com/questions/58990498/package-json-exports-field-not-working-with-typescript
This was how I discovered this issue: