Registry / web-framework / dts-bundle-webpack

dts-bundle-webpack

JSON →
library1.0.2jsnpmunverified

A webpack plugin that wraps the dts-bundle library to generate a single bundled .d.ts declaration file from TypeScript compiler output. Version 1.0.2, last updated in 2017. It merges all generated declaration files into one, supporting options like externals, exclude, removeSource, and verbose. However, the underlying dts-bundle is unmaintained, and the plugin relies on CommonJS require(). No longer recommended for modern webpack 5+ TypeScript projects.

npm install dts-bundle-webpack
INSTALL
IMPORT
SIG · DTS-BUNDLE-WEBPACK
D
dts-bundle-webpack
web-frameworkjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const DtsBundleWebpack = require('dts-bundle-webpack');
import DtsBundleWebpack from 'dts-bundle-webpack';
Package only provides a CommonJS default export; ESM import may fail or require synthetic default interop.
DtsBundleWebpack
const DtsBundleWebpack = require('dts-bundle-webpack');
const { DtsBundleWebpack } = require('dts-bundle-webpack');
The plugin is exported as a single class/function, not as a named export.
Plugin constructor
new DtsBundleWebpack({ name: 'myLib', main: 'build/index.d.ts' })
Plugin must be instantiated with options object; see dts-bundle documentation for option details.

Configures webpack with ts-loader and dts-bundle-webpack plugin to generate a single .d.ts bundle from index.d.ts output.

const path = require('path'); const DtsBundleWebpack = require('dts-bundle-webpack'); module.exports = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, resolve: { extensions: ['.ts', '.js'], }, module: { rules: [ { test: /\.ts$/, loader: 'ts-loader' }, ], }, plugins: [ new DtsBundleWebpack({ name: 'myLib', main: 'build/index.d.ts', out: 'dist/myLib.d.ts', removeSource: false, outputAsModuleFolder: true, }), ], };
Debug
Known issues
deprecateddts-bundle is unmaintained since 2017; alternative tools like api-extractor or tsc --declaration are recommended.
fix
Use @microsoft/api-extractor or tsc's built-in declaration output.
affects: >=1.0.0
gotchaPlugin only works with webpack 4 and earlier; not compatible with webpack 5 without modifications.
fix
Check compatibility or migrate to webpack 4 or use an alternative.
affects: >=1.0.0
gotchaOptions must match dts-bundle's schema exactly; no validation is performed by the plugin.
fix
Refer to dts-bundle documentation for valid options.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: DtsBundleWebpack is not a constructor
Using ES6 import without default interop or incorrect require() path.
fix
Use const DtsBundleWebpack = require('dts-bundle-webpack');
Error: Cannot find module 'dts-bundle'
Missing peer dependency dts-bundle.
fix
Run npm install dts-bundle --save-dev
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
dts-bundlerequiredCore dependency for bundling .d.ts files
Agent activity
39 hits · last 30 days
node
34
OpenAI (training)
1
Resources
dts-bundle-webpack — npm install dts-bundle-webpack · libregistry