Skip to content

Commit eb56cd3

Browse files
authored
docs: add hint for whether to enable dts.build (#1212)
1 parent e190d8d commit eb56cd3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

packages/plugin-dts/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ pluginDts({
104104

105105
Whether to generate declaration files with building the project references. This is equivalent to using the `--build` flag with the `tsc` command. See [Project References](https://www.typescriptlang.org/docs/handbook/project-references.html) for more details.
106106

107+
When the project references are configured but the referenced project has not been built separately (for example, the source code of other projects is directly referenced in monorepo, but the corresponding declaration file is missing in the project), this option needs to be enabled to ensure that the declaration files of referenced projects can be generated correctly, thereby ensuring the integrity of the type system.
108+
107109
When this option is enabled, you must explicitly set `declarationDir` or `outDir` in `tsconfig.json` in order to meet the build requirements.
108110

109111
### abortOnError

website/docs/en/config/lib/dts.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export default {
161161

162162
Whether to generate declaration files with building the project references. This is equivalent to using the `--build` flag with the `tsc` command. See [Project References](https://www.typescriptlang.org/docs/handbook/project-references.html) for more details.
163163

164+
When the project references are configured but the referenced project has not been built separately (for example, the source code of other projects is directly referenced in monorepo, but the corresponding declaration file is missing in the project), this option needs to be enabled to ensure that the declaration files of referenced projects can be generated correctly, thereby ensuring the integrity of the type system.
165+
164166
::: note
165167

166168
When this option is enabled, you must explicitly set `declarationDir` or `outDir` in `tsconfig.json` in order to meet the build requirements.

website/docs/zh/config/lib/dts.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export default {
161161

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

164+
在配置了 project references 但被引用的项目尚未单独构建时(例如在 monorepo 中直接引用其他项目的源代码,但项目中缺少对应的类型声明文件),需要开启此选项,以确保能够正确生成依赖项目的类型声明,从而保障类型系统的完整性。
165+
164166
::: note
165167

166168
当启用此选项时,你必须在 `tsconfig.json` 中显式设置 `declarationDir``outDir` 以满足构建要求。

0 commit comments

Comments
 (0)