{"id":21993,"library":"rollup-plugin-dts-bundle","title":"rollup-plugin-dts-bundle","description":"A Rollup plugin that bundles all generated .d.ts files into a single declaration file using dts-bundle under the hood. Version 1.0.0 is the latest stable release; the project appears to be maintained sporadically. It integrates seamlessly with Rollup's build hooks (default writeBundle) and provides options like file cleanup and verbosity. Compared to alternatives like rollup-plugin-dts or @rollup/plugin-dts, this plugin offers less configuration overhead but relies on the older dts-bundle library.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/dmitrytut/rollup-plugin-dts-bundle","tags":["javascript","rollup","rollup-plugin","dts","dts-bundle","merge","typescript","typings"],"install":[{"cmd":"npm install rollup-plugin-dts-bundle","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-dts-bundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-dts-bundle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency handling the actual .d.ts bundling logic","package":"dts-bundle","optional":false},{"reason":"Required peer dependency for the plugin interface","package":"rollup","optional":false}],"imports":[{"note":"The package exports a single default function; ESM import is preferred for Rollup configs.","wrong":"const dtsBundle = require('rollup-plugin-dts-bundle')","symbol":"default","correct":"import dtsBundle from 'rollup-plugin-dts-bundle'"},{"note":"This package does not export any types; the Rollup Plugin type can be used for TypeScript support.","wrong":"import { Plugin } from 'rollup-plugin-dts-bundle'","symbol":"Plugin","correct":"import type { Plugin } from 'rollup'"},{"note":"The options interface is not exported; users should define their own or use inline types.","wrong":"","symbol":"Options","correct":"interface DtsBundleOptions { bundle: {...}; deleteOnComplete?: string[]; verbose?: boolean; hook?: string; }"}],"quickstart":{"code":"// rollup.config.js\nimport typescript from 'rollup-plugin-typescript2';\nimport dtsBundle from 'rollup-plugin-dts-bundle';\n\nexport default {\n  input: 'src/index.ts',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    typescript({ tsconfig: './tsconfig.json' }),\n    dtsBundle({\n      bundle: {\n        name: 'my-library',\n        main: 'dist/index.d.ts',\n        out: 'bundle.d.ts',\n        removeSource: true\n      },\n      deleteOnComplete: ['dist/**/*.d.ts', '!dist/bundle.d.ts'],\n      verbose: true\n    })\n  ]\n};","lang":"javascript","description":"Rollup config with typescript2 plugin and dts-bundle plugin to bundle .d.ts files into one."},"warnings":[{"fix":"Ensure your .d.ts files are generated correctly; use the removeSource option to avoid duplicate declarations.","message":"The plugin requires dts-bundle, which is an older library with its own quirks (e.g., does not handle re-exports well).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set hook to 'buildEnd' or 'generateBundle' based on your Rollup version and workflow.","message":"Default hook is writeBundle, which runs after the bundle is written. If you use generateBundle, types may not be available yet.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using rollup-plugin-dts or @microsoft/api-extractor for more robust declaration bundling.","message":"dts-bundle is in maintenance mode and may not support modern TypeScript features like project references or strict mode.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install dts-bundle --save-dev' or 'yarn add dts-bundle -D'","cause":"Missing peer dependency dts-bundle which is not automatically installed","error":"Error: Cannot find module 'dts-bundle'"},{"fix":"Use 'import dtsBundle from 'rollup-plugin-dts-bundle'' in your config","cause":"Using require instead of import in an ES module context, or incorrect import syntax","error":"TypeError: dtsBundle is not a function"},{"fix":"Provide a bundle object with at least 'name' and 'main' properties","cause":"Missing or incorrectly named 'bundle' configuration object","error":"Error: The 'bundle' option is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}