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/basic/configure-rslib.mdx
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,13 @@ The configuration structure of Rslib looks like this:
10
10
11
11
```js title="rslib.config.mjs"
12
12
exportdefault {
13
-
// Array of library configurations.
13
+
// Array of Lib configurations.
14
14
// Each object represents a set of independent configurations for each output format.
15
-
// Distinct configurations can be specified in each object, which is a superset of Rsbuild configurations.
15
+
// Distinct configurations can be specified in each object, which is a superset of Rsbuild configurations along with Rslib's specific configurations.
16
16
lib: [
17
-
// The first set of configurations
17
+
// The first set of Lib configurations
18
18
{
19
-
// Independent lib configuration of ESM format
19
+
// Independent Rslib specific configurations
20
20
format:'esm', // options for the output format of JavaScript files
21
21
bundle:true, // options for the build type
22
22
autoExtension:true, // options for the extensions of JavaScript files
@@ -41,7 +41,7 @@ export default {
41
41
footer: {
42
42
// options for the file footer
43
43
},
44
-
// Independent Rsbuild configuration
44
+
// Independent Rsbuild configurations
45
45
output: {
46
46
// options for build outputs
47
47
},
@@ -54,16 +54,16 @@ export default {
54
54
plugins: [
55
55
// configure Rsbuild plugins
56
56
],
57
-
// other independent Rsbuild configuration options
57
+
// other independent Rsbuild configurations
58
58
},
59
59
{
60
-
// The second set of configurations of CJS format
60
+
// The second set of Lib configurations
61
61
format:'cjs',
62
-
// ... other independent lib configurations and Rsbuild configurations
62
+
// ... other independent Rslib specific configurations and Rsbuild configurations
63
63
},
64
-
// ... Extra sets of configurations (if needed)
64
+
// ... Additional sets of Lib configurations (if needed)
65
65
],
66
-
// Shared Rsbuild configuration which will be merged into each of the above lib configuration objects
66
+
// Shared Rsbuild configurations
67
67
output: {
68
68
// options for build outputs
69
69
},
@@ -76,18 +76,17 @@ export default {
76
76
plugins: [
77
77
// configure Rsbuild plugins
78
78
],
79
-
// ... other Rsbuild configuration options
79
+
// ... other Rsbuild configurations
80
80
};
81
81
```
82
82
83
83
The configuration file exports a default object that includes a `lib` array and shared Rsbuild configuration options. You can find detailed descriptions of all configs on the [Configure Overview](/config/) page.
84
84
85
-
-**[Lib Configuration](/config/lib) (at least one object is required)**: The `lib` array contains multiple objects, each representing a set of independent configurations tailored for different output formats, such as ESM and CJS. Each object within the `lib` array can specify distinct configurations, which is a superset of Rsbuild configurations.
86
-
-**Independent [lib Configuration](/config/lib) (only [format](/config/lib/format) is required)**: The configuration options extended by Rslib. Rslib will transform these options into adapted Rsbuild configuration of each object.
87
-
-**Independent [Rsbuild Configuration](/config/rsbuild) (optional)**: The configuration options provided by Rsbuild which can override the shared Rsbuild configuration outside.
88
-
-**Shared [Rsbuild Configuration](/config/rsbuild) (optional)**: Outside the `lib` array, there are shared Rsbuild configuration options that will be deep merged with independent Rsbuild configuration of each `lib` configuration object.
85
+
-**[Lib configurations](/config/lib) (at least one object is required)**: The `lib` array contains multiple objects, each representing a set of independent configurations that will generate different outputs. Each object within the `lib` array can specify unique configurations, which is a superset of Rsbuild
86
+
configurations along with Rslib's specific configurations.
87
+
-**Shared [Rsbuild configurations](/config/rsbuild) (optional)**: Outside the `lib` array, there are shared Rsbuild configuration options that will be deep merged with independent Rsbuild configuration of each `lib` configuration object.
89
88
90
-
Rslib generates corresponding Rsbuild [environments](https://rsbuild.dev/guide/advanced/environments) configurations based on the multiple build configurations of different output formats. See [Configuration Debug](#configuration-debug)for more details.
89
+
Rslib generates corresponding Rsbuild [environments](https://rsbuild.dev/guide/advanced/environments) configurations based on the multiple build configurations of different output formats. You can view the final generated configurations through the [configuration debug](#configuration-debug)documentation.
0 commit comments