I have encountered a problem while creating npm
library with Typescript. I have created a few react
components. Creating declaration files and then combining all of them in one and declaring the module.
Where to put my .d.ts declarations when distributing npm package?
For an example of something that is built on TypeScript and is distributed on npm, take a look at RxJS. There are a lot of considerations to distributing your code on npm
that are well outside of the scope of just TypeScript. You need to consider if you will distribute your code as CJS, UMD, ES6 (or even AMD) modules and what types of loaders you expect people to use your code with, etc.
We do not have a clear guidance here. we have some documentation https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages, but clearly this is not nearly sufficient.
I think we can close this issue.
Most helpful comment
We do not have a clear guidance here. we have some documentation https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages, but clearly this is not nearly sufficient.