File tree Expand file tree Collapse file tree 12 files changed +83
-1
lines changed
packages/core/src/types/config
website/docs/en/config/lib Expand file tree Collapse file tree 12 files changed +83
-1
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,78 @@ export type Redirect = {
7272} ;
7373
7474export interface LibConfig extends RsbuildConfig {
75+ /**
76+ * Whether to bundle the library.
77+ * @default true
78+ */
7579 bundle ?: boolean ;
80+ /**
81+ * Output format for the generated JavaScript files.
82+ * @default undefined
83+ */
7684 format ?: Format ;
85+ /**
86+ * Whether to automatically set the file extension based on the `format` option in the JS and DTS output files.
87+ * @default true
88+ */
7789 autoExtension ?: boolean ;
90+ /**
91+ * Whether to automatically externalize dependencies and do not bundle them.
92+ * @default true
93+ */
7894 autoExternal ?: AutoExternal ;
95+ /**
96+ * Configure the redirect of the import paths.
97+ * @default {}
98+ */
7999 redirect ?: Redirect ;
80- /** Support esX and browserslist query */
100+ /**
101+ * Support esX and browserslist query
102+ * @default 'esnext'
103+ */
81104 syntax ?: Syntax ;
105+ /**
106+ * Whether to import SWC helper functions from `@swc/helpers` instead of inlining them.
107+ * @default false
108+ */
82109 externalHelpers ?: boolean ;
110+ /**
111+ * Inject content into the top of each JS, CSS or DTS file.
112+ * @default {}
113+ */
83114 banner ?: BannerAndFooter ;
115+ /**
116+ * Inject content into the bottom of each JS, CSS or DTS file.
117+ * @default {}
118+ */
84119 footer ?: BannerAndFooter ;
120+ /**
121+ * Configure the shims for CommonJS and ESM output.
122+ *
123+ * @default
124+ * ```js
125+ * const defaultShims = {
126+ * cjs: {
127+ * 'import.meta.url': true,
128+ * },
129+ * esm: {
130+ * __filename: false,
131+ * __dirname: false,
132+ * require: false,
133+ * },
134+ * };
135+ * ```
136+ */
85137 shims ?: Shims ;
138+ /**
139+ * Configure the generation of the TypeScript declaration files.
140+ * @default false
141+ */
86142 dts ?: Dts ;
143+ /**
144+ * The export name of the UMD bundle.
145+ * @default undefined
146+ */
87147 umdName ?: string ;
88148}
89149
Original file line number Diff line number Diff line change 22
33- ** Type:** ` boolean `
44- ** Default:** ` true `
5+
6+ Whether to automatically set the file extension based on the ` format ` option in the JS and DTS output files.
Original file line number Diff line number Diff line change 22
33- ** Type:** ` boolean `
44- ** Default:** ` true `
5+
6+ Whether to automatically externalize dependencies and do not bundle them.
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ type Banner = {
1111```
1212
1313- ** Default:** ` {} `
14+
15+ Inject content into the top of each JS, CSS or DTS file.
Original file line number Diff line number Diff line change 22
33- ** Type:** ` boolean `
44- ** Default:** ` true `
5+
6+ Whether to bundle the library.
Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ type Dts =
1515```
1616
1717- ** Default:** ` undefined `
18+
19+ Configure the generation of the TypeScript declaration files.
Original file line number Diff line number Diff line change 22
33- ** Type:** ` boolean `
44- ** Default:** ` false `
5+
6+ Whether to import SWC helper functions from ` @swc/helpers ` instead of inlining them.
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ type Footer = {
1111```
1212
1313- ** Default:** ` {} `
14+
15+ Inject content into the bottom of each JS, CSS or DTS file.
Original file line number Diff line number Diff line change 22
33- ** Type:** ` string `
44- ** Default:** ` undefined `
5+
6+ Output format for the generated JavaScript files.
Original file line number Diff line number Diff line change @@ -9,3 +9,5 @@ type Redirect = {
99```
1010
1111- ** Default:** ` {} `
12+
13+ Configure the redirect of the import paths.
You can’t perform that action at this time.
0 commit comments