{"id":17581,"library":"dts-webpack-bundler","title":"DTS Webpack Bundler","description":"This Webpack plugin is designed to generate TypeScript declaration (`.d.ts`) files for each entry point (chunk) within a Webpack build process. It leverages the `dts-bundle` library to consolidate individual TypeScript declaration files into bundled outputs. The package, currently at version 1.0.3, was last updated in October 2017 and explicitly supports only Webpack v3.x. Given the subsequent major releases of Webpack (v4, v5, etc.), this plugin is not compatible with modern Webpack environments. Its release cadence is non-existent, as it has been unmaintained for over six years. Key differentiators at the time of its release included chunk-specific `.d.ts` bundling, a feature now handled by more contemporary and actively maintained plugins that support current Webpack versions. Users seeking to bundle TypeScript declarations in modern Webpack projects should consider alternative solutions.","status":"abandoned","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/eliraz-refael/dts-webpack-bundler","tags":["javascript","dts","defenition-files","typscript","webpack","bundler"],"install":[{"cmd":"npm install dts-webpack-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add dts-webpack-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add dts-webpack-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library used for bundling the TypeScript declaration files.","package":"dts-bundle","optional":false},{"reason":"Peer dependency, explicitly supporting only Webpack v3.x.","package":"webpack","optional":false}],"imports":[{"note":"The package was released before widespread ESM adoption in Node.js and is primarily consumed via CommonJS `require`.","wrong":"import DtsWebpackBundler from 'dts-webpack-bundler';","symbol":"DtsWebpackBundler","correct":"const DtsWebpackBundler = require('dts-webpack-bundler');"}],"quickstart":{"code":"const path = require('path');\nconst DtsWebpackBundler = require('dts-webpack-bundler');\n\n// tsconfig.json excerpt (required for this plugin):\n// {\n//     \"compilerOptions\": {\n//         \"declaration\": true,\n//         \"declarationDir\": \"./typings/\"\n//     }\n// }\n\nmodule.exports = {\n    entry: './src/main.ts',\n    output: {\n        path: path.resolve(__dirname, 'dist'),\n        filename: 'index.js'\n    },\n    plugins: [\n        new DtsWebpackBundler({\n\t\t\tlibName: 'my-library',\n\t\t\ttypingsDir: path.resolve(process.cwd(), 'typings'),\n\t\t\toutputDir: path.resolve(process.cwd(), 'build'),\n\t\t\tdeleteSource: true // Deletes the typings folder after bundling.\n        })\n    ]\n};\n","lang":"javascript","description":"Demonstrates how to configure `dts-webpack-bundler` in a `webpack.config.js` file, including necessary `tsconfig.json` settings."},"warnings":[{"fix":"Migrate to a modern d.ts bundling solution for Webpack, such as `npm-dts-webpack-plugin`, `bundle-declarations-webpack-plugin`, or `types-webpack-bundler` (a Webpack 5 compatible fork).","message":"This plugin explicitly supports only Webpack v3.x. It will not function correctly with Webpack v4, v5, or later versions due to significant API changes in Webpack.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure your `tsconfig.json` includes `\"declaration\": true` and `\"declarationDir\": \"./some-typings-folder/\"`. The `typingsDir` option in the plugin configuration must point to this exact folder.","message":"The plugin requires `declaration` to be `true` and `declarationDir` to be properly configured in `tsconfig.json`. All generated declaration files must be gathered into this single directory for the plugin to process them correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"It is highly recommended to use an actively maintained alternative for d.ts bundling in Webpack projects.","message":"The package is no longer maintained, with the last publish over six years ago. This means there will be no updates for new Webpack versions, TypeScript features, or bug fixes.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Use `const DtsWebpackBundler = require('dts-webpack-bundler');` for CommonJS environments.","cause":"Attempting to use `import` syntax (ESM) with a CommonJS-only package, or incorrect capitalization.","error":"TypeError: DtsWebpackBundler is not a constructor"},{"fix":"Verify that `tsconfig.json` has `\"declaration\": true` and `\"declarationDir\": \"./path/to/typings\"`, and that `typingsDir` in `DtsWebpackBundler` options matches this path exactly. Also, ensure TypeScript is correctly compiling your source files.","cause":"The `typingsDir` option in the plugin configuration does not correctly point to the directory specified in `tsconfig.json`'s `declarationDir`, or the TypeScript compiler did not generate any .d.ts files.","error":"Error: Typings directory not found or no .d.ts files found for bundling."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}