Skip to content

Commit e351fc5

Browse files
Copilotchenjiahan
andauthored
docs: improve documentation authenticity and readability (#5972)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: chenjiahan <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent 8c16667 commit e351fc5

File tree

20 files changed

+106
-106
lines changed

20 files changed

+106
-106
lines changed

website/docs/en/api/start/index.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JavaScript API
22

3-
Rsbuild provides a complete set of JavaScript APIs for developers to build higher level tools or frameworks on top of Rsbuild.
3+
Rsbuild provides a comprehensive JavaScript API for developers to build higher-level tools or frameworks on top of Rsbuild.
44

55
Rsbuild's JavaScript API can be used in Node.js, Deno, or Bun.
66

@@ -30,30 +30,30 @@ The `createRsbuild` method provides some options, which you can learn more about
3030

3131
### 3. Call Rsbuild instance method
3232

33-
The Rsbuild instance provides some methods, which you can use according to the usage scenarios.
33+
The Rsbuild instance provides several methods that you can use according to your scenario.
3434

35-
To start local development, it is recommended to use the [rsbuild.startDevServer](/api/javascript-api/instance#rsbuildstartdevserver) method, which will start a local dev server.
35+
For local development, we recommend using the [rsbuild.startDevServer](/api/javascript-api/instance#rsbuildstartdevserver) method, which starts a local dev server.
3636

3737
```ts
3838
await rsbuild.startDevServer();
3939
```
4040

41-
After successfully starting dev server, you can see the following logs:
41+
After successfully starting the dev server, you will see the following logs:
4242

4343
```
4444
➜ Local: http://localhost:3000
4545
➜ Network: http://192.168.0.1:3000
4646
```
4747

48-
To deploy the App to production environment, it is recommended to use the [rsbuild.build](/api/javascript-api/instance#rsbuildbuild) method, which will build the production outputs.
48+
For production deployment, we recommend using the [rsbuild.build](/api/javascript-api/instance#rsbuildbuild) method, which builds the production outputs.
4949

5050
```ts
5151
await rsbuild.build();
5252
```
5353

5454
> For more introduction of Rsbuild instance methods, please read the [Rsbuild Instance](/api/javascript-api/instance) chapter.
5555
56-
After completing the above three steps, you have learned the basic usage of Rsbuild. Next, you can customize the build process through Rsbuild plugins and configurations.
56+
After completing these three steps, you have learned the basic usage of Rsbuild. Next, you can customize the build process through Rsbuild plugins and configurations.
5757

5858
## Exports format
5959

@@ -67,4 +67,4 @@ import { createRsbuild } from '@rsbuild/core';
6767
const { createRsbuild } = require('@rsbuild/core');
6868
```
6969

70-
> It is recommended to use ES modules format, which is more in line with the community standards.
70+
> We recommend using the ES modules format, which better aligns with community standards.

website/docs/en/config/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const nodeConfig = {
133133

134134
## Environment name
135135

136-
Since environment names are used for directory names and object property names, it is recommended to only include letters, numbers, `-`, `_`, and `$`. When using other characters, Rsbuild will output a warning to prompt you.
136+
Since environment names are used for directory names and object property names, we recommend using only letters, numbers, `-`, `_`, and `$`. When using other characters, Rsbuild will display a warning.
137137

138138
```ts
139139
export default {

website/docs/en/config/output/asset-prefix.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
In [production mode](/config/mode), use this option to set the URL prefix for static assets, such as setting it to a CDN URL.
77

8-
`assetPrefix` will affect the URLs of most of the static assets, including JavaScript files, CSS files, images, videos, etc. If an incorrect value is specified, you'll receive 404 errors while loading these resources.
8+
`assetPrefix` affects the URLs of most static assets, including JavaScript files, CSS files, images, videos, etc. If an incorrect value is specified, you'll receive 404 errors while loading these resources.
99

10-
This config is only used in `production` mode or `none` mode. In `development` mode, use the [dev.assetPrefix](/config/dev/asset-prefix) to set the URL prefix.
10+
This configuration is only used in `production` mode or `none` mode. In `development` mode, use the [dev.assetPrefix](/config/dev/asset-prefix) to set the URL prefix.
1111

1212
## Example
1313

website/docs/en/config/output/clean-dist-path.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ type CleanDistPath = boolean | 'auto' | CleanDistPathObject;
88

99
- **Default:** `'auto'`
1010

11-
Whether to clean up all files in the output directory before the build starts. The output directory is the [output.distPath.root](/config/output/dist-path) directory.
11+
Configure whether to clean up all files in the output directory before the build starts. The output directory is the [output.distPath.root](/config/output/dist-path) directory.
1212

1313
## Default behavior
1414

1515
The default value of `output.cleanDistPath` is `'auto'`:
1616

1717
- In development mode, if [dev.writeToDisk](/config/dev/write-to-disk) is `false`, Rsbuild will not perform cleanup.
18-
- In any mode, if [output.distPath.root](/config/output/dist-path) is an external directory or equals to the project root directory, Rsbuild will not perform cleanup to avoid accidentally deleting files from other directories.
18+
- In any mode, if [output.distPath.root](/config/output/dist-path) is an external directory or equals the project root directory, Rsbuild will not perform cleanup to avoid accidentally deleting files from other directories.
1919

2020
```js
2121
export default {

website/docs/en/config/output/css-modules.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
- **Type:** `CSSModules`
44

5-
For custom CSS Modules configuration.
5+
Configure custom CSS Modules settings.
66

7-
The CSS Modules feature of Rsbuild is based on the `modules` option of css-loader. You can refer to [css-loader - modules](https://github.com/webpack-contrib/css-loader?tab=readme-ov-file#modules) to learn more.
7+
The CSS Modules feature in Rsbuild is based on the `modules` option of css-loader. You can refer to [css-loader - modules](https://github.com/webpack-contrib/css-loader?tab=readme-ov-file#modules) to learn more.
88

99
## cssModules.auto
1010

11-
The `auto` configuration option allows CSS Modules to be automatically enabled based on their filenames.
11+
The `auto` configuration option allows CSS Modules to be automatically enabled based on filenames.
1212

1313
- **Type:**
1414

@@ -27,7 +27,7 @@ type Auto =
2727

2828
Type description:
2929

30-
- `true`: enable CSS Modules for all files matching `/\.module\.\w+$/i.test(filename)` regexp.
30+
- `true`: enable CSS Modules for all files matching the `/\.module\.\w+$/i.test(filename)` regexp.
3131
- `false`: disable CSS Modules.
3232
- `RegExp`: enable CSS Modules for all files matching `/RegExp/i.test(filename)` regexp.
3333
- `function`: enable CSS Modules for files based on the filename satisfying your filter function check.

website/docs/en/config/output/dist-path.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ const defaultDistPath = {
4040
};
4141
```
4242

43-
Set the directory of the output files. Rsbuild will emit files to the specified subdirectory according to the file type.
43+
Configure the directory for output files. Rsbuild will emit files to the specified subdirectory according to the file type.
4444

4545
> See [Output files](/guide/basic/output-files) for more information.
4646
4747
## File types
4848

49-
`output.distPath` can be set differently for different file types.
49+
`output.distPath` can be configured differently for different file types.
5050

5151
Here are the details of each `output.distPath` option:
5252

5353
- `root`: The root directory of all output files.
5454
- `html`: The output directory of HTML files.
5555
- `favicon`: The output directory of favicon files.
5656
- `js`: The output directory of JavaScript files.
57-
- `jsAsync`: The output directory of async JavaScript files, which by default will be output to the `async` subdirectory of `distPath.js`.
57+
- `jsAsync`: The output directory of async JavaScript files, which by default are output to the `async` subdirectory of `distPath.js`.
5858
- `css`: The output directory of CSS style files.
59-
- `cssAsync`: The output directory of async CSS files, which by default will be output to the `async` subdirectory of `distPath.css`.
59+
- `cssAsync`: The output directory of async CSS files, which by default are output to the `async` subdirectory of `distPath.css`.
6060
- `svg`: The output directory of SVG images.
6161
- `font`: The output directory of font files.
6262
- `wasm`: The output directory of WebAssembly files.
@@ -66,7 +66,7 @@ Here are the details of each `output.distPath` option:
6666

6767
## Root directory
6868

69-
The `root` is the root directory of the build artifacts and can be specified as a relative or absolute path. If `root` is a relative path, it will be appended to the project's root directory to form an absolute path.
69+
The `root` is the root directory of the build artifacts and can be specified as a relative or absolute path. If `root` is a relative path, it is appended to the project's root directory to form an absolute path.
7070

7171
Other directories can only be specified as relative paths and will be output relative to the `root` directory.
7272

website/docs/en/config/output/filename-hash.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
- **Type:** `boolean | string`
44
- **Default:** `true`
55

6-
Whether to add a hash value to the filename after the production build.
6+
Configure whether to add a hash value to the filename after the production build.
77

88
### Disable hash
99

10-
By default, the filename of the output files will include a hash value:
10+
By default, output file names include a hash value:
1111

1212
```bash
1313
dist/static/css/index.7879e19d.css
1414
dist/static/js/index.18a568e5.js
1515
```
1616

17-
You can set `output.filenameHash` to false to disable this behavior:
17+
You can set `output.filenameHash` to `false` to disable this behavior:
1818

1919
```js
2020
export default {
@@ -24,7 +24,7 @@ export default {
2424
};
2525
```
2626

27-
After rebuilding, the output filenames becomes:
27+
After rebuilding, the output filenames become:
2828

2929
```bash
3030
dist/static/css/index.css

website/docs/en/config/output/legal-comments.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
- **Type:** `'linked' | 'inline' | 'none'`
44
- **Default:** `'linked'`
55

6-
Configure how to handle the legal comments.
6+
Configure how to handle legal comments.
77

88
## What are legal comments?
99

10-
A "legal comment" is considered to be any statement-level comment in JS or rule-level comment in CSS that contains @license or @preserve or that starts with //! or /\*!. These comments are preserved in output files by default since that follows the intent of the original authors of the code.
10+
A "legal comment" is any statement-level comment in JS or rule-level comment in CSS that contains @license or @preserve, or that starts with //! or /\*!. These comments are preserved in output files by default since that follows the intent of the original authors of the code.
1111

1212
For example, the `LICENSE` comment in React:
1313

website/docs/en/config/output/manifest.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Configure how to generate the manifest file.
1010
- `string`: Generate a manifest file with the specified filename or path.
1111
- `object`: Generate a manifest file with the specified options.
1212

13-
The manifest file contains the information of all assets, and the mapping relationship between [entry module](/config/source/entry) and assets.
13+
The manifest file contains information about all assets and the mapping between [entry modules](/config/source/entry) and assets.
1414

1515
## Basic example
1616

@@ -49,7 +49,7 @@ After building, Rsbuild will generate a `dist/manifest.json` file:
4949

5050
## Manifest structure
5151

52-
By default, the manifest file will be output in the following structure:
52+
The manifest file will be output with the following structure by default:
5353

5454
```ts
5555
type FilePath = string;
@@ -255,7 +255,7 @@ export default {
255255

256256
## Multiple environments
257257

258-
When using [environments](/config/environments) and configuring multiple environments, please specify a unique `manifest.filename` value for each environment to prevent manifest files from different environments from overwriting each other.
258+
When using [environments](/config/environments) with multiple environments, please specify a unique `manifest.filename` value for each environment to prevent manifest files from different environments from overwriting each other.
259259

260260
For example, use the default `manifest.json` for the `web` environment and use `manifest-node.json` for the `node` environment:
261261

@@ -279,7 +279,7 @@ export default {
279279
};
280280
```
281281

282-
You can also choose to generate the manifest file for a specific environment:
282+
You can also choose to generate the manifest file only for specific environments:
283283

284284
```ts title="rsbuild.config.ts"
285285
export default {

website/docs/en/config/output/minify.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type Minify =
1515

1616
- **Default:** `true`
1717

18-
Configure whether to enable code minification in production mode, and to configure minimizer options.
18+
Configure whether to enable code minification in production mode and configure minimizer options.
1919

20-
By default, JS and CSS code will be automatically minimized in production mode to improve page performance. If you do not want to minify the code, you can set `minify` to `false` to disable minification for all code. Alternatively, you can control the behavior of code minification through detailed configuration of the `minify` option. Below are detailed explanations for each configuration option:
20+
By default, JS and CSS code are automatically minified in production mode to improve page performance. If you don't want to minify the code, you can set `minify` to `false` to disable minification for all code. Alternatively, you can control code minification behavior through detailed configuration of the `minify` option. Below are detailed explanations for each configuration option:
2121

2222
:::tip
2323
Rsbuild uses [SWC](/guide/configuration/swc) to minify JS code and [Lightning CSS](/guide/styling/css-usage#lightning-css) to minify CSS code by default.

0 commit comments

Comments
 (0)