Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a Webpack Bundled Library with Typescript

I'm trying to build a library of typescript components that will be consumed by another library that is also typescript based. We are currently using webpack to accomplish our bundling, with ts-loader as the loader to consume the TS files.

I'm unsure of how to generate the .d.ts files for the example library below. Typescript does build the .d.ts files (with declaration set to true) but it is one file per module where I need one .d.ts file that can be used by consumers.

https://github.com/raybooysen/typescript-webpack-example

So my question is, is there a canonical example of how to accomplish this? Is there a way that typescript consumers can import these .d.ts files correctly? At the moment there seems to be very little documentation and examples on the net and would appreciate any help.

like image 212
Ray Booysen Avatar asked Mar 18 '16 15:03

Ray Booysen


1 Answers

I eventually opened an issue on the Typescript Github page and they have confirmed this is not possible:

https://github.com/Microsoft/TypeScript/issues/8372#issuecomment-217219512

like image 98
Ray Booysen Avatar answered Oct 05 '22 20:10

Ray Booysen