Registry / devops / rollup-plugin-dts-bundle-generator

rollup-plugin-dts-bundle-generator

JSON →
library1.4.0jsnpmunverified

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.

npm install rollup-plugin-dts-bundle-generator
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-DTS-
R
rollup-plugin-dts-bundle-generator
devopsjavascriptv1.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

generateDtsBundle
import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator'
import generateDtsBundle from 'rollup-plugin-dts-bundle-generator'
Function is exported as a named export, not default.
PluginConfig
import type { PluginConfig } from 'rollup-plugin-dts-bundle-generator'
import { PluginConfig } from 'rollup-plugin-dts-bundle-generator'
Type-only import for TypeScript to avoid runtime errors.
EntryPointConfig
import type { EntryPointConfig } from 'rollup-plugin-dts-bundle-generator'
import { EntryPointConfig } from 'rollup-plugin-dts-bundle-generator'
Type-only import; prevents bundling at runtime.
CompilationOptions
import type { CompilationOptions } from 'rollup-plugin-dts-bundle-generator'
import { CompilationOptions } from 'rollup-plugin-dts-bundle-generator'
Type-only import; not available as runtime value.

Configures Rollup plugin to generate a bundled .d.ts file with custom output path and compiler settings.

import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator'; export default { input: 'src/index.ts', output: { file: 'dist/bundle.js', format: 'cjs' }, plugins: [ generateDtsBundle({ outFile: 'types/index.d.ts', compilation: { preferredConfigPath: 'tsconfig.build.json' } }) ] };
Debug
Known issues
gotchaThe plugin may generate incorrect declarations if the TypeScript config has incompatible settings like composite or declarationMap. Ensure output dir is set explicitly.
fix
Upgrade to version 1.2.0+ or set outFile explicitly.
affects: <1.2.0
deprecatedUsing options.entry without specifying outFile may cause silent failures. The entry option is pending deprecation in favor of deriving from Rollup config.
fix
Rely on auto-derivation from Rollup input/output or specify outFile explicitly.
affects: >=1.0.0
breakingVersion 1.4.0 changed the default behavior for output path derivation when using multiple outputs. Now uses first output's file or dir.
fix
If using multiple outputs, set outFile explicitly to avoid unexpected file generation.
affects: <1.4.0
gotchaThe plugin does not work with Rollup's output.preserveModules or preserveEntrySignatures. These options may interfere with declaration generation.
fix
Set preserveModules: false and preserveEntrySignatures: 'strict' in Rollup config.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: generateDtsBundle is not a function
Using default import instead of named import
fix
Use `import { generateDtsBundle } from 'rollup-plugin-dts-bundle-generator'`
Error: Could not find a 'tsconfig.json'
TypeScript config file not found or not specified
fix
Pass compilation.preferredConfigPath in options, or ensure tsconfig.json exists in project root.
ENOENT: no such file or directory, open '...'
Output directory does not exist
fix
Create the output directory before running the build, or use a path that exists.
Missing required argument: entry
No EntryPointConfig provided and Rollup config lacks input or output details
fix
Specify entry in options or ensure Rollup config has valid input and output.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
dts-bundle-generatorrequiredCore functionality for bundling .d.ts files
Agent activity
3 hits · last 30 days
node
2
Resources
rollup-plugin-dts-bundle-generator — npm install rollup-plugin-dts-bundle-generator · libregistry