dts-webpack-bundler
This Webpack plugin generate a single TypeScript *.d.ts declaration file per entry (per chunk) using dts-bundle.
Currently supporting only webpack v3.x
Installation
$ npm install dts-webpack-bundler --save-dev
Usage
First you need to add the following to tsconfig.json:
"declarationDir"
properly.
NOTE: currently this plugin support only declaration files that are gathered into a single folder so, please make sure you're using "compilerOptions": // ... "declaration": true "declarationDir": "./typings/"
Then in your webpack.config.js:
const DtsWebpackBundler = ; moduleexports = entry: './src/main.ts' output: path: path filename: 'index.js' plugins: libName: 'library-name' typingsDir: path outputDir: path deleteSource: true // deletes the typings folder after bundling it.