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
+10-7Lines changed: 10 additions & 7 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 title="rslib.config.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,11 +73,12 @@ 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
+
// [!code highlight:3]
81
82
dts: {
82
83
bundle: true,
83
84
},
@@ -106,11 +107,12 @@ 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',
115
+
// [!code highlight:3]
114
116
dts: {
115
117
distPath: './dist-types',
116
118
},
@@ -143,11 +145,12 @@ 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.
@@ -181,7 +183,7 @@ First, set up Storybook with the Rslib project. You can refer to the [Storybook
181
183
182
184
2. Then set up the Storybook configuration file `.storybook/main.ts`, specify the stories and addons, and set the framework with corresponding framework integration.
0 commit comments