H5Wasm already defines an exports field but without a types entry for TypeScript. As a result, I think that TS looks at the import entry, which points to a JS file, and then tries to infer the types from that, which doesn't work as well as looking at the generated types and leads to any warnings with strict: true.
To be honest, this behaviour feels quite unintuitive to me, as I would have expected TS to fall back to reading the root types property in package.json ... but :shrug:
While I'm at it, I'm also re-exporting a couple of helper types that we use in H5Web and were previously importing with a hacky path (which no longer works with moduleResolution: "bundler"... :sweat_smile:)
With this new module resolution option, TypeScript looks at the
exports
field of packages.H5Wasm already defines an
exports
field but without atypes
entry for TypeScript. As a result, I think that TS looks at theimport
entry, which points to a JS file, and then tries to infer the types from that, which doesn't work as well as looking at the generated types and leads toany
warnings withstrict: true
.To be honest, this behaviour feels quite unintuitive to me, as I would have expected TS to fall back to reading the root
types
property inpackage.json
... but :shrug:While I'm at it, I'm also re-exporting a couple of helper types that we use in H5Web and were previously importing with a hacky path (which no longer works with
moduleResolution: "bundler"
... :sweat_smile:)