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: website/docs/en/guide/advanced/dts.mdx
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,24 @@ import { PackageManagerTabs } from '@theme';
58
58
59
59
2. Set `dts: { bundle: true }` in the Rslib configuration file.
60
60
61
+
It should be noted that during the generation of declaration files, Rslib will automatically enforce some configuration options in `tsconfig.json` to ensure that the [TypeScript Compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API) generates only declaration files.
62
+
63
+
```json
64
+
{
65
+
"compilerOptions": {
66
+
"noEmit": false,
67
+
"declaration": true,
68
+
"emitDeclarationOnly": true
69
+
}
70
+
}
71
+
```
72
+
73
+
The priority from highest to lowest of final output directory of declaration files:
74
+
75
+
- The configuration option [dts.distPath](/config/lib/dts#dtsdistpath)
76
+
- The configuration option `declarationDir` in `tsconfig.json`
77
+
- The configuration option [output.distPath.root](/config/rsbuild/output#outputdistpath)
78
+
61
79
::: tip
62
80
63
81
You can refer to [lib.dts](/config/lib/dts) for more details about declaration files configuration.
0 commit comments