{"id":21992,"library":"rollup-plugin-dts-bundle-generator","title":"rollup-plugin-dts-bundle-generator","description":"A Rollup plugin that wraps dts-bundle-generator to produce a single, flattened .d.ts bundle from TypeScript declarations. Current version 1.4.0, released with MIT license. It aims to solve the long-standing difficulty of generating bundled TypeScript typings in Rollup builds with a zero-config approach, deriving defaults from Rollup input/output. Supports entry point configuration and compilation options. Compared to alternatives like rollup-plugin-dts, it focuses on simplicity and relies on dts-bundle-generator which is actively maintained. Ships TypeScript types.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup","dts-bundle-generator","typescript","types","typings","dts","d.ts","declaration"],"install":[{"cmd":"npm install rollup-plugin-dts-bundle-generator","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-dts-bundle-generator","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-dts-bundle-generator","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core functionality for bundling .d.ts files","package":"dts-bundle-generator","optional":false}],"imports":[{"note":"Function is exported as a named export, not default.","wrong":"import generateDtsBundle from 'rollup-plugin-dts-bundle-generator'","symbol":"generateDtsBundle","correct":"import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator'"},{"note":"Type-only import for TypeScript to avoid runtime errors.","wrong":"import { PluginConfig } from 'rollup-plugin-dts-bundle-generator'","symbol":"PluginConfig","correct":"import type { PluginConfig } from 'rollup-plugin-dts-bundle-generator'"},{"note":"Type-only import; prevents bundling at runtime.","wrong":"import { EntryPointConfig } from 'rollup-plugin-dts-bundle-generator'","symbol":"EntryPointConfig","correct":"import type { EntryPointConfig } from 'rollup-plugin-dts-bundle-generator'"},{"note":"Type-only import; not available as runtime value.","wrong":"import { CompilationOptions } from 'rollup-plugin-dts-bundle-generator'","symbol":"CompilationOptions","correct":"import type { CompilationOptions } from 'rollup-plugin-dts-bundle-generator'"}],"quickstart":{"code":"import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator';\n\nexport default {\n  input: 'src/index.ts',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'cjs'\n  },\n  plugins: [\n    generateDtsBundle({\n      outFile: 'types/index.d.ts',\n      compilation: {\n        preferredConfigPath: 'tsconfig.build.json'\n      }\n    })\n  ]\n};","lang":"typescript","description":"Configures Rollup plugin to generate a bundled .d.ts file with custom output path and compiler settings."},"warnings":[{"fix":"Upgrade to version 1.2.0+ or set outFile explicitly.","message":"The plugin may generate incorrect declarations if the TypeScript config has incompatible settings like composite or declarationMap. Ensure output dir is set explicitly.","severity":"gotcha","affected_versions":"<1.2.0"},{"fix":"Rely on auto-derivation from Rollup input/output or specify outFile explicitly.","message":"Using options.entry without specifying outFile may cause silent failures. The entry option is pending deprecation in favor of deriving from Rollup config.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"If using multiple outputs, set outFile explicitly to avoid unexpected file generation.","message":"Version 1.4.0 changed the default behavior for output path derivation when using multiple outputs. Now uses first output's file or dir.","severity":"breaking","affected_versions":"<1.4.0"},{"fix":"Set preserveModules: false and preserveEntrySignatures: 'strict' in Rollup config.","message":"The plugin does not work with Rollup's output.preserveModules or preserveEntrySignatures. These options may interfere with declaration generation.","severity":"gotcha","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":"Use `import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator'`","cause":"Using default import instead of named import","error":"TypeError: generateDtsBundle is not a function"},{"fix":"Pass compilation.preferredConfigPath in options, or ensure tsconfig.json exists in project root.","cause":"TypeScript config file not found or not specified","error":"Error: Could not find a 'tsconfig.json'"},{"fix":"Create the output directory before running the build, or use a path that exists.","cause":"Output directory does not exist","error":"ENOENT: no such file or directory, open '...'"},{"fix":"Specify entry in options or ensure Rollup config has valid input and output.","cause":"No EntryPointConfig provided and Rollup config lacks input or output details","error":"Missing required argument: entry"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}