talira

rollup-plugin-dts

Bundle TypeScript .d.ts declaration files with Rollup

open sourceLGPL-3.0-onlyfree

rollup-plugin-dts is a Rollup plugin that rolls up a library's TypeScript .d.ts declaration files into a single bundled declaration file, so a package can ship one types file. It marks external libraries (such as @types packages) as external automatically, and can load declaration maps for detailed source maps that keep Go to Definition working.

Problems it solves

  • ship a single bundled .d.ts file with my TypeScript library
  • roll up TypeScript declaration files with Rollup
  • publish one types entry for an npm package

Features

  • bundles .d.ts files into one declaration file
  • externals such as @types left out automatically
  • declaration maps for Go to Definition

Alternatives

The same job

These do what rollup-plugin-dts does.

  1. tsdown Library bundler for TypeScript and JavaScript, built on Rolldown
  2. unplugin-dts Generate .d.ts declaration files from TypeScript or Vue sources in your bundler
  3. tsup Zero-config bundler for TypeScript libraries, powered by esbuild
  4. TSDX Zero-config CLI for developing, testing and publishing TypeScript packages
  5. Rolldown Fast Rust bundler for JavaScript and TypeScript with a Rollup-compatible API
  6. Rollup ES module bundler for JavaScript libraries and apps, with tree shaking

Compare rollup-plugin-dts with the top 3