Skip to content

Commit

Permalink
docs: add simple description for rollup types
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Aug 4, 2023
1 parent fc51b68 commit 0c2c199
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export default defineConfig({
})
```

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

If you want to merge all declarations into one file, just specify `rollupTypes: true`:

```ts
{
plugins: [dts({ rollupTypes: true })]
}
```

Starting with `3.0.0`, you can use this plugin with Rollup.

## FAQ
Expand Down
12 changes: 11 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pnpm i vite-plugin-dts -D

## 使用

`vite.config.ts`:
`vite.config.ts`

```ts
import { resolve } from 'path'
Expand All @@ -43,6 +43,16 @@ export default defineConfig({
})
```

默认情况,生成的类型文件会跟随源文件的结构。

如果你希望将所有的类型合并到一个文件中,只需指定 `rollupTypes: true`

```ts
{
plugins: [dts({ rollupTypes: true })]
}
```

`3.0.0` 开始,你可以在 Rollup 中使用该插件。

## 常见问题
Expand Down

0 comments on commit 0c2c199

Please sign in to comment.