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/config/lib/dts.mdx
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,25 +26,25 @@ Configure the generation of the TypeScript declaration files.
26
26
27
27
Declaration files generation is an optional feature, you can set `dts: true` to enable [bundleless declaration files](/guide/advanced/dts#bundleless-declaration-files) generation.
28
28
29
-
```ts title="rslib.config.ts" {5}
29
+
```ts
30
30
exportdefault {
31
31
lib: [
32
32
{
33
33
format: 'esm',
34
-
dts: true,
34
+
dts: true,// [!code highlight]
35
35
},
36
36
],
37
37
};
38
38
```
39
39
40
40
If you want to disable declaration files generation, you can set `dts: false` or do not specify the `dts` option.
41
41
42
-
```ts title="rslib.config.ts" {5}
42
+
```ts title="rslib.config.ts"
43
43
exportdefault {
44
44
lib: [
45
45
{
46
46
format: 'esm',
47
-
dts: false,
47
+
dts: false,// [!code highlight]
48
48
},
49
49
],
50
50
};
@@ -73,14 +73,15 @@ import { PackageManagerTabs } from '@theme';
73
73
74
74
2. Set `dts.bundle` to `true`.
75
75
76
-
```ts title="rslib.config.ts" {5-7}
76
+
```ts title="rslib.config.ts"
77
77
exportdefault {
78
78
lib: [
79
79
{
80
80
format: 'esm',
81
81
dts: {
82
-
bundle: true,
83
-
},
82
+
// [!code highlight]
83
+
bundle: true, // [!code highlight]
84
+
}, // [!code highlight]
84
85
},
85
86
],
86
87
};
@@ -106,14 +107,15 @@ The default value follows the priority below:
106
107
107
108
#### Example
108
109
109
-
```ts title="rslib.config.ts" {5-7}
110
+
```ts title="rslib.config.ts"
110
111
exportdefault {
111
112
lib: [
112
113
{
113
114
format: 'esm',
114
115
dts: {
115
-
distPath: './dist-types',
116
-
},
116
+
// [!code highlight]
117
+
distPath: './dist-types', // [!code highlight]
118
+
}, // [!code highlight]
117
119
},
118
120
],
119
121
};
@@ -143,14 +145,15 @@ By default, type errors will cause the build to fail.
143
145
144
146
When `abortOnError` is set to `false` like below, the build will still succeed even if there are type issues in the code.
0 commit comments