Using ES-module with TypeScript on React

26 Views Asked by At

We currently export our package using NPM and trying to use ES-module to publish the package as a file. The issue is all these type-definitions will not there with the module file and that causes issues to the consumers who wanted to integrate with TypeScript. Is there a way we can do this export?

I tried to export the type definition separately in a new NPM package and for hack I added a face d.ts file for the es-module on the client side. But those seems like a hacky ways.

0

There are 0 best solutions below