You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-dts/README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ An [Rsbuild plugin](https://www.npmjs.com/package/rsbuild-plugin-dts) to emit de
8
8
9
9
## Using in Rslib
10
10
11
-
Read [DTS](https://lib.rsbuild.dev/guide/advanced/dts) and [lib.dts](https://lib.rsbuild.dev/config/lib/dts) for more details.
11
+
Read [Declaration files](https://lib.rsbuild.dev/guide/advanced/dts) and [lib.dts](https://lib.rsbuild.dev/config/lib/dts) for more details.
12
12
13
13
## Using in Rsbuild
14
14
@@ -36,11 +36,11 @@ export default {
36
36
-**Type:**`boolean`
37
37
-**Default:**`false`
38
38
39
-
Whether to bundle the DTS files.
39
+
Whether to bundle the declaration files.
40
40
41
-
If you want to [bundle DTS](https://lib.rsbuild.dev/guide/advanced/dts#bundle-dts) files, you should:
41
+
If you want to [bundle declaration files](https://lib.rsbuild.dev/guide/advanced/dts#bundle-declaration-files) files, you should:
42
42
43
-
1. Install `@microsoft/api-extractor` as a development dependency, which is the underlying tool used for bundling DTS files.
43
+
1. Install `@microsoft/api-extractor` as a development dependency, which is the underlying tool used for bundling declaration files.
44
44
45
45
```bash
46
46
npm add @microsoft/api-extractor -D
@@ -58,7 +58,7 @@ pluginDts({
58
58
59
59
-**Type:**`string`
60
60
61
-
The output directory of DTS files. The default value follows the priority below:
61
+
The output directory of declaration files. The default value follows the priority below:
62
62
63
63
1. The `distPath` value of the plugin options.
64
64
2. The `declarationDir` value in the `tsconfig.json` file.
@@ -75,7 +75,7 @@ pluginDts({
75
75
-**Type:**`boolean`
76
76
-**Default:**`false`
77
77
78
-
Whether to generate DTS 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.
78
+
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.
79
79
80
80
When this option is enabled, you must explicitly set `declarationDir` or `outDir` in `tsconfig.json` in order to meet the build requirements.
81
81
@@ -84,7 +84,7 @@ When this option is enabled, you must explicitly set `declarationDir` or `outDir
84
84
-**Type:**`boolean`
85
85
-**Default:**`true`
86
86
87
-
Whether to abort the build process when an error occurs during DTS generation.
87
+
Whether to abort the build process when an error occurs during declaration files generation.
88
88
89
89
By default, type errors will cause the build to fail.
90
90
@@ -101,7 +101,7 @@ pluginDts({
101
101
-**Type:**`string`
102
102
-**Default:**`'.d.ts'`
103
103
104
-
The extension of the DTS file.
104
+
The extension of the declaration file.
105
105
106
106
```js
107
107
pluginDts({
@@ -114,7 +114,7 @@ pluginDts({
114
114
-**Type:**`boolean`
115
115
-**Default:**`true`
116
116
117
-
Whether to automatically externalize dependencies of different dependency types and do not bundle them into the DTS file.
117
+
Whether to automatically externalize dependencies of different dependency types and do not bundle them into the declaration file.
118
118
119
119
The default value of `autoExternal` is `true`, which means the following dependency types will not be bundled:
120
120
@@ -142,7 +142,7 @@ pluginDts({
142
142
-**Type:**`string`
143
143
-**Default:**`undefined`
144
144
145
-
Inject content into the top of each DTS file.
145
+
Inject content into the top of each declaration file.
146
146
147
147
```js
148
148
pluginDts({
@@ -155,7 +155,7 @@ pluginDts({
155
155
-**Type:**`string`
156
156
-**Default:**`undefined`
157
157
158
-
Inject content into the bottom of each DTS file.
158
+
Inject content into the bottom of each declaration file.
159
159
160
160
```js
161
161
pluginDts({
@@ -201,7 +201,7 @@ pluginDts({
201
201
202
202
Whether to automatically redirect the import paths of TypeScript declaration output files.
203
203
204
-
- When set to `true`, Rslib will redirect the import path in the DTS output file to the corresponding relative path based on the [compilerOptions.paths](https://typescriptlang.org/tsconfig#paths) configured in `tsconfig.json`.
204
+
- When set to `true`, Rslib will redirect the import path in the declaration output file to the corresponding relative path based on the [compilerOptions.paths](https://typescriptlang.org/tsconfig#paths) configured in `tsconfig.json`.
205
205
206
206
```ts
207
207
// `compilerOptions.paths` is set to `{ "@/*": ["src/*"] }`
Whether to automatically redirect the file extension to import paths based on the TypeScript declaration output files.
223
223
224
-
- When set to `true`, the import paths in DTS files will be redirected to the corresponding JavaScript extension which can be resolved to corresponding DTS file. The extension of the DTS output file is related to the `dtsExtension` configuration.
224
+
- When set to `true`, the import paths in declaration files will be redirected to the corresponding JavaScript extension which can be resolved to corresponding declaration file. The extension of the declaration output file is related to the `dtsExtension` configuration.
'With the `abortOnError` configuration currently turned off, type errors do not cause build failures, but they do not guarantee proper type file output.',
208
+
'With `abortOnError` configuration currently disabled, type errors will not fail the build, but proper type declaration output cannot be guaranteed.',
Copy file name to clipboardExpand all lines: website/docs/en/config/lib/banner.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ type Banner = {
16
16
17
17
-**Default:**`{}`
18
18
19
-
Inject content into the top of each JavaScript, CSS or DTS output file.
19
+
Inject content into the top of each JavaScript, CSS or declaration output file.
20
20
21
21
## Object type
22
22
@@ -39,7 +39,7 @@ Inject content into the top of each CSS output file.
39
39
-**Type:**`string`
40
40
-**Default:**`undefined`
41
41
42
-
Inject content into the top of each DTS output file.
42
+
Inject content into the top of each declaration output file.
43
43
44
44
## Notice
45
45
@@ -73,6 +73,6 @@ export default {
73
73
74
74
:::warning
75
75
76
-
The banner content in DTS files is handled differently from JavaScript and CSS output files. It is written directly using the file system API, so setting `BannerPlugin` will not affect it.
76
+
The banner content in declaration files is handled differently from JavaScript and CSS output files. It is written directly using the file system API, so setting `BannerPlugin` will not affect it.
Copy file name to clipboardExpand all lines: website/docs/en/config/lib/bundle.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ export default {
75
75
76
76
::: note
77
77
78
-
If [DTS generation](/config/lib/dts) is enabled, remember to set [exclude](https://www.typescriptlang.org/tsconfig/#exclude) field in `tsconfig.json` to avoid generating TypeScript declaration files for the corresponding files.
78
+
If [declaration files generation](/config/lib/dts) is enabled, remember to set [exclude](https://www.typescriptlang.org/tsconfig/#exclude) field in `tsconfig.json` to avoid generating TypeScript declaration files for the corresponding files.
79
79
80
80
For example, exclude test files within the `src` folder:
0 commit comments