Skip to content

Commit a527200

Browse files
committed
fix: add tsdoc for config options
1 parent fe69381 commit a527200

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

packages/core/src/types/config/index.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,59 +80,67 @@ export type Redirect = {
8080
export interface LibConfig extends RsbuildConfig {
8181
/**
8282
* The unique identifier of the library.
83-
* @default undefined
83+
* @defaultValue `undefined`
8484
*/
8585
id?: string;
8686
/**
8787
* Output format for the generated JavaScript files.
88-
* @default undefined
88+
* @defaultValue `undefined`
89+
* @see {@link https://lib.rsbuild.dev/config/lib/format}
8990
*/
9091
format?: Format;
9192
/**
9293
* Whether to bundle the library.
93-
* @default true
94+
* @defaultValue `true`
95+
* @see {@link https://lib.rsbuild.dev/config/lib/bundle}
9496
*/
9597
bundle?: boolean;
9698
/**
97-
* Whether to automatically set the file extension based on the `format` option in the JavaScript output files.
98-
* @default true
99+
* Whether to automatically set the file extension based on {@link format} option in the JavaScript output files.
100+
* @defaultValue `true`
101+
* @see {@link https://lib.rsbuild.dev/config/lib/auto-extension}
99102
*/
100103
autoExtension?: boolean;
101104
/**
102105
* Whether to automatically externalize dependencies of different dependency types and do not bundle them.
103-
* @default true
106+
* @defaultValue `true`
107+
* @see {@link https://lib.rsbuild.dev/config/lib/auto-external}
104108
*/
105109
autoExternal?: AutoExternal;
106110
/**
107-
* Configure the redirect of the import paths, applicable when `bundle: false`.
108-
* @default {}
111+
* Configure the redirect of the import paths, applicable {@link bundle} is set to `false`.
112+
* @defaultValue `{}`
113+
* @see {@link https://lib.rsbuild.dev/config/lib/redirect}
109114
*/
110115
redirect?: Redirect;
111116
/**
112117
* Configure the syntax to which JavaScript and CSS will be downgraded.
113-
* Support ECMAScript version and browserslist query.
114-
* @default 'esnext'
118+
* @defaultValue `'esnext'`
119+
* @see {@link https://lib.rsbuild.dev/config/lib/syntax}
115120
*/
116121
syntax?: Syntax;
117122
/**
118123
* Whether to import SWC helper functions from `@swc/helpers` instead of inlining them.
119-
* @default false
124+
* @defaultValue `false`
125+
* @see {@link https://lib.rsbuild.dev/config/lib/external-helpers}
120126
*/
121127
externalHelpers?: boolean;
122128
/**
123129
* Inject content into the top of each JS, CSS or DTS file.
124-
* @default {}
130+
* @defaultValue `{}`
131+
* @see {@link https://lib.rsbuild.dev/config/lib/banner}
125132
*/
126133
banner?: BannerAndFooter;
127134
/**
128135
* Inject content into the bottom of each JS, CSS or DTS file.
129-
* @default {}
136+
* @defaultValue `{}`
137+
* @see {@link https://lib.rsbuild.dev/config/lib/footer}
130138
*/
131139
footer?: BannerAndFooter;
132140
/**
133141
* Configure the shims for CommonJS and ESM output.
134142
*
135-
* @default
143+
* @defaultValue
136144
* ```js
137145
* const defaultShims = {
138146
* cjs: {
@@ -145,16 +153,19 @@ export interface LibConfig extends RsbuildConfig {
145153
* },
146154
* };
147155
* ```
156+
* @see {@link https://lib.rsbuild.dev/config/lib/shims}
148157
*/
149158
shims?: Shims;
150159
/**
151160
* Configure the generation of the TypeScript declaration files.
152-
* @default false
161+
* @defaultValue `false`
162+
* @see {@link https://lib.rsbuild.dev/config/lib/dts}
153163
*/
154164
dts?: Dts;
155165
/**
156166
* The export name of the UMD bundle.
157-
* @default undefined
167+
* @defaultValue `undefined`
168+
* @see {@link https://lib.rsbuild.dev/config/lib/umd-name}
158169
*/
159170
umdName?: string;
160171
}

0 commit comments

Comments
 (0)