talira

unplugin-dts

Generate .d.ts declaration files from TypeScript or Vue sources in your bundler

open sourceMITfree

unplugin-dts (formerly vite-plugin-dts) generates TypeScript declaration files (*.d.ts) from .ts, .tsx or .vue source files when building a library, for example in Vite's library mode. Rewritten as an unplugin, it now works with Vite, Rollup, Rolldown, Webpack, Rspack and esbuild, and can bundle the types into one file. The Vite-only vite-plugin-dts package is still published but no longer recommended. It needs Node.js 20 or later.

Problems it solves

  • generate TypeScript declarations when building a Vite library
  • emit .d.ts files for a Vue component library
  • bundle a library's types into one file

Features

  • generates .d.ts files from TypeScript and Vue sources
  • works with Vite, Rollup, Rolldown, Webpack, Rspack and esbuild
  • can bundle types into one file

Alternatives

The same job

These do what unplugin-dts does.

  1. tsdown Library bundler for TypeScript and JavaScript, built on Rolldown
  2. rollup-plugin-dts Bundle TypeScript .d.ts declaration files with Rollup
  3. tsup Zero-config bundler for TypeScript libraries, powered by esbuild
  4. Vite Next Generation Frontend Tooling
  5. TSDX Zero-config CLI for developing, testing and publishing TypeScript packages
  6. esbuild An extremely fast bundler for the web

Compare unplugin-dts with the top 3