Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions website/docs/en/guide/advanced/dts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ The priority from highest to lowest of final output directory of declaration fil
- The configuration option `declarationDir` in `tsconfig.json`
- The configuration option [output.distPath.root](/config/rsbuild/output#outputdistpath)

::: tip

You can refer to [lib.dts](/config/lib/dts) for more details about declaration files configuration.

:::
## Related configuration of declaration files

| Configuration item | Description |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [dts.bundle](/config/lib/dts#dtsbundle) | Whether to bundle the declaration files. |
| [dts.distPath](/config/lib/dts#dtsdistpath) | The output directory of declaration files. |
| [dts.build](/config/lib/dts#dtsbuild) | Whether to generate declaration files with building the project references. |
| [dts.abortOnError](/config/lib/dts#dtsabortonerror) | Whether to abort the build process when an error occurs during declaration files generation. |
| [dts.autoExtension](/config/lib/dts#dtsautoextension) | Whether to automatically set the declaration file extension based on the [format](/config/lib/format) option. |
| [banner.dts](/config/lib/banner#bannerdts) | Inject content into the top of each declaration output file. |
| [footer.dts](/config/lib/footer#footerdts) | Inject content into the bottom of each declaration file. |
| [redirect.dts.path](/config/lib/redirect#redirectdtspath) | Whether to automatically redirect the import paths of TypeScript declaration output files. |
| [redirect.dts.extension](/config/lib/redirect#redirectdtsextension) | Whether to automatically redirect the file extension to import paths based on the TypeScript declaration output files. |
2 changes: 1 addition & 1 deletion website/docs/zh/config/lib/dts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default {
- **类型:** `boolean`
- **默认值:** `false`

是否在生成类型声明文件时构建项目的 references。这相当于在 `tsc` 命令中使用 `--build` 标志。更多详细信息请参考 [项目引用](https://www.typescriptlang.org/docs/handbook/project-references.html)。
是否在生成类型声明文件时构建项目的 project references。这相当于在 `tsc` 命令中使用 `--build` 标志。更多详细信息请参考 [项目引用](https://www.typescriptlang.org/docs/handbook/project-references.html)。

::: note

Expand Down
18 changes: 13 additions & 5 deletions website/docs/zh/guide/advanced/dts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ import { PackageManagerTabs } from '@theme';
- `tsconfig.json` 中的 `declarationDir` 配置项
- [output.distPath.root](/config/rsbuild/output#outputdistpath) 配置项

::: tip

你可以参考 [lib.dts](/config/lib/dts) 获取更多有关类型声明文件配置的详细信息。

:::
## 类型声明文件的相关配置

| 配置项 | 描述说明 |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [dts.bundle](/config/lib/dts#dtsbundle) | 是否打包类型声明文件。 |
| [dts.distPath](/config/lib/dts#dtsdistpath) | 类型声明文件的输出目录。 |
| [dts.build](/config/lib/dts#dtsbuild) | 是否在生成类型声明文件时构建项目的 project references。 |
| [dts.abortOnError](/config/lib/dts#dtsabortonerror) | 当类型声明文件生成过程中出现错误时,是否中止构建过程。 |
| [dts.autoExtension](/config/lib/dts#dtsautoextension) | 是否根据 [format](/config/lib/format) 选项自动设置类型声明文件扩展名。 |
| [banner.dts](/config/lib/banner#bannerdts) | 在每个类型声明文件顶部注入内容。 |
| [footer.dts](/config/lib/footer#footerdts) | 在每个类型声明文件底部注入内容。 |
| [redirect.dts.path](/config/lib/redirect#redirectdtspath) | 是否自动重定向类型声明文件中的导入路径。 |
| [redirect.dts.extension](/config/lib/redirect#redirectdtsextension) | 是否根据类型声明文件自动重定向文件扩展名到导入路径。 |
Loading