Registry / devops / rollup-dts-bundler

rollup-dts-bundler

JSON →
library1.0.4jsnpmunverified

Rollup plugin that bundles .d.ts files accurately using @microsoft/api-extractor. Current stable version 1.0.4 (released 2025), maintained on GitHub with automated CI and Renovate for dependency updates. Unlike alternatives like rollup-plugin-dts or dts-bundle-generator, this plugin avoids mangling type names and preserves re-exports by leveraging Microsoft's official api-extractor via a simple Rollup interface. Requires Rollup ^4.0.0 and TypeScript ^6.0.0 as peer dependencies.

npm install rollup-dts-bundler
INSTALL
IMPORT
SIG · ROLLUP-DTS-BUNDLER
R
rollup-dts-bundler
devopsjavascriptv1.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

dts
import { dts } from 'rollup-dts-bundler'
const dts = require('rollup-dts-bundler')
ESM-only package; CJS require will fail.
dts (default import)
import dts from 'rollup-dts-bundler'
import { dts } from 'rollup-dts-bundler'
Package also exports a default export; both work.

Minimal Rollup config to bundle .d.ts from src/index.ts to dist/index.d.ts using the dts plugin.

// rollup.config.js import { dts } from 'rollup-dts-bundler'; export default { input: 'src/index.ts', output: { file: 'dist/index.d.ts', format: 'es', }, plugins: [dts()], };
Debug
Known issues
breakingRequires Rollup 4+, TypeScript 6+ peer deps
fix
Upgrade Rollup to v4 and TypeScript to v6.
affects: <1.0.0
gotchaPlugin only works in generateBundle hook; Rollup input/output config forward to api-extractor, not standard typescript plugin.
fix
Do not use other TypeScript plugins in same bundle; this plugin solely handles .d.ts emission.
affects: >=0
gotchaExternal types (e.g. @types/*) automatically excluded; cannot override without bundling workaround.
fix
If you need to bundle external types, use bundledPackages option.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module '@microsoft/api-extractor'
Missing peer dependency @microsoft/api-extractor
fix
npm install --save-dev @microsoft/api-extractor
Error: require() of ES Module not supported
Using CommonJS require for this ESM-only package
fix
Use import syntax or dynamic import()
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
@microsoft/api-extractorrequiredcore bundling engine
typescriptrequiredrequired by api-extractor for declaration emit
Agent activity
6 hits · last 30 days
node
6
Resources
rollup-dts-bundler — npm install rollup-dts-bundler · libregistry