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
muslnode 18–226 runs
build_error
glibcnode 18–226 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,
}),
],
};
Errors
Common errors & fixes
TypeError: DtsBundleWebpack is not a constructor
Using ES6 import without default interop or incorrect require() path.
fixUse const DtsBundleWebpack = require('dts-bundle-webpack'); Error: Cannot find module 'dts-bundle'
Missing peer dependency dts-bundle.
fixRun npm install dts-bundle --save-dev
Audit
Dependencies
dts-bundlerequiredCore dependency for bundling .d.ts files