# vite-plugin-dts

> vite-plugin-dts

Latest version **5.1.0** (published 2026-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-plugin-dts
pnpm add vite-plugin-dts
yarn add vite-plugin-dts
bun add vite-plugin-dts
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2026-09-01 |
| First published | 2021-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1526 |
| Author | qmhc |
| Maintainers | qmhc |
| Keywords | vite, vite-plugin, ts, dts, typescript, vue, tsc, vue-tsc, volar |

## Links

- npm: https://www.npmjs.com/package/vite-plugin-dts
- Repository: https://github.com/qmhc/unplugin-dts
- Homepage: https://github.com/qmhc/unplugin-dts#readme
- Issues: https://github.com/qmhc/unplugin-dts/issues
- npm.io page: https://npm.io/package/vite-plugin-dts

## Dependencies (1)

- [unplugin-dts](https://npm.io/package/unplugin-dts.md) 1.1.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 5.1.0 (latest) — 2026-09-01
- 5.0.0-beta.6 (beta) — 2025-07-31
- 4.2.3-dev.2 (dev) — 2024-09-30
- 5.0.3 — 2026-06-24
- 5.0.2 — 2026-06-01
- 5.0.1 — 2026-05-19
- 5.0.0 — 2026-04-30
- 5.0.0-beta.5 — 2025-07-30
- 5.0.0-beta.4 — 2025-07-13
- 5.0.0-beta.3 — 2025-07-07
- 5.0.0-beta.2 — 2025-06-18
- 5.0.0-beta.1 — 2025-06-16
- 5.0.0-beta.0 — 2025-05-18
- 4.5.4 — 2025-05-15
- 4.5.3 — 2025-03-03
- … 120 more at https://npm.io/package/vite-plugin-dts/versions

## README

<h1 align="center">vite-plugin-dts</h1>

<p align="center">
(Do not recommend anymore, please use <code>unplugin-dts</code> instead)
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/vite-plugin-dts">
    <img src="https://img.shields.io/npm/v/vite-plugin-dts?color=orange&label=" alt="version" />
  </a>
  <a href="https://github.com/qmhc/vite-plugin-dts/blob/main/LICENSE">
    <img src="https://img.shields.io/npm/l/vite-plugin-dts" alt="license" />
  </a>
</p>

## Install

```sh
pnpm i -D vite-plugin-dts
```

## Usage

In `vite.config.ts`:

```ts
import { resolve } from 'path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'

export default defineConfig({
  build: {
    lib: {
      entry: resolve(__dirname, 'src/index.ts'),
      name: 'MyLib',
      formats: ['es'],
      fileName: 'my-lib',
    },
  },
  plugins: [dts()],
})
```

By default, the generated declaration files are following the source structure.

Fortunately, with the help of [API Extractor](https://api-extractor.com/), the plugin can bundle all types into a single file. You just need to install `@microsoft/api-extractor` and set `bundleTypes: true`:

```ts
export default defineConfig({
  plugins: [dts({ bundleTypes: true })],
})
```

If you start with official Vite template, you should specify the `tsconfigPath`:

```ts
export default defineConfig({
  plugins: [dts({ tsconfigPath: './tsconfig.app.json' })],
})
```

## Documentation

For full documentation, please refer to [unplugin-dts](../../docs/en/usage.md).

## Example

A real project using this plugin: [Vexip UI](https://github.com/vexip-ui/vexip-ui).

## License

MIT License.

---
_Source: https://npm.io/package/vite-plugin-dts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
