Webpack plugin that bundles TypeScript declaration files (.d.ts) into a single output file using dts-bundle-generator. Version 6.0.0 supports Webpack 5+, Node >=16, and is ESM-only since v6 (dropped CJS support). It wraps dts-bundle-generator (v9.3.1) with Webpack integration, allowing per-entry configuration, inline libraries, sorting, and banner control. Unlike similar plugins, it focuses on minimal configuration, supports multiple entry points and bundles, and exposes full dts-bundle-generator options. Release cadence is irregular, driven by dependency updates.
npm install bundle-declarations-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal Webpack configuration to bundle TypeScript declarations using the plugin with default options; outputs index.d.ts alongside index.js.
Use import syntax or downgrade to v5.1.1 if CJS is required.
Use object format: new BundleDeclarationsWebpackPlugin({ entry: { filePath: './src/index.ts' } }).Ensure entry files have at least one export statement.
Set { entry: { output: { sortNodes: true } } }.Review dts-bundle-generator v9 migration guide; options like 'preferredConfigPath' may have changed.
Run 'npm audit' regularly; consider overriding vulnerable transitive deps if needed.
Upgrade to v5.1.1 or later; use forward slashes in configuration paths.
Change to import statement or downgrade to v5.1.1.
Use: import BundleDeclarationsWebpackPlugin from 'bundle-declarations-webpack-plugin'
Verify entry path and file extension; entry must point to a TypeScript file.
Run: npm install dts-bundle-generator --save-dev
Ensure new BundleDeclarationsWebpackPlugin() is added to the plugins array in Webpack config.