{"id":19449,"library":"dts-bundle-webpack","title":"dts-bundle-webpack","description":"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.","status":"deprecated","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/Appius/dts-bundle-webpack","tags":["javascript","webpack","dts-bundle"],"install":[{"cmd":"npm install dts-bundle-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add dts-bundle-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add dts-bundle-webpack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for bundling .d.ts files","package":"dts-bundle","optional":false}],"imports":[{"note":"Package only provides a CommonJS default export; ESM import may fail or require synthetic default interop.","wrong":"import DtsBundleWebpack from 'dts-bundle-webpack';","symbol":"default","correct":"const DtsBundleWebpack = require('dts-bundle-webpack');"},{"note":"The plugin is exported as a single class/function, not as a named export.","wrong":"const { DtsBundleWebpack } = require('dts-bundle-webpack');","symbol":"DtsBundleWebpack","correct":"const DtsBundleWebpack = require('dts-bundle-webpack');"},{"note":"Plugin must be instantiated with options object; see dts-bundle documentation for option details.","wrong":"","symbol":"Plugin constructor","correct":"new DtsBundleWebpack({ name: 'myLib', main: 'build/index.d.ts' })"}],"quickstart":{"code":"const path = require('path');\nconst DtsBundleWebpack = require('dts-bundle-webpack');\n\nmodule.exports = {\n  entry: './src/index.ts',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js',\n  },\n  resolve: {\n    extensions: ['.ts', '.js'],\n  },\n  module: {\n    rules: [\n      { test: /\\.ts$/, loader: 'ts-loader' },\n    ],\n  },\n  plugins: [\n    new DtsBundleWebpack({\n      name: 'myLib',\n      main: 'build/index.d.ts',\n      out: 'dist/myLib.d.ts',\n      removeSource: false,\n      outputAsModuleFolder: true,\n    }),\n  ],\n};","lang":"javascript","description":"Configures webpack with ts-loader and dts-bundle-webpack plugin to generate a single .d.ts bundle from index.d.ts output."},"warnings":[{"fix":"Use @microsoft/api-extractor or tsc's built-in declaration output.","message":"dts-bundle is unmaintained since 2017; alternative tools like api-extractor or tsc --declaration are recommended.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Check compatibility or migrate to webpack 4 or use an alternative.","message":"Plugin only works with webpack 4 and earlier; not compatible with webpack 5 without modifications.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Refer to dts-bundle documentation for valid options.","message":"Options must match dts-bundle's schema exactly; no validation is performed by the plugin.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const DtsBundleWebpack = require('dts-bundle-webpack');","cause":"Using ES6 import without default interop or incorrect require() path.","error":"TypeError: DtsBundleWebpack is not a constructor"},{"fix":"Run npm install dts-bundle --save-dev","cause":"Missing peer dependency dts-bundle.","error":"Error: Cannot find module 'dts-bundle'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}