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.
- tsdown Library bundler for TypeScript and JavaScript, built on Rolldown
- rollup-plugin-dts Bundle TypeScript .d.ts declaration files with Rollup
- tsup Zero-config bundler for TypeScript libraries, powered by esbuild
- Vite Next Generation Frontend Tooling
- TSDX Zero-config CLI for developing, testing and publishing TypeScript packages
- esbuild An extremely fast bundler for the web
