Creating a Webpack Bundled Library with Typescript

Viewed 2851

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.

3 Answers
Related