dts-webpack-plugin
That Webpack plugin generate single TypeScript *.d.ts declaration file using dts-bundle.
Installation
$ npm install dts-webpack-plugin --save-dev
Usage
First you need to add the following to tsconfig.json:
"compilerOptions": // ... "declaration": true "declarationDir": "./"
Then in your webpack.config.js:
const DtsPlugin = ; moduleexports = entry: './src/main.ts' output: path: path filename: 'index.js' plugins: name: 'project-name'
Result
Asset Size Chunks Chunk Names index.js 566 bytes 0 [emitted] mainindex.d.ts 333 bytes [emitted]