Skip to content

Commit eeebfe5

Browse files
Copilotchenjiahan
andauthored
docs: improve clarity and naturalness of English documentation (#6345)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: chenjiahan <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent 722829b commit eeebfe5

File tree

9 files changed

+25
-25
lines changed

9 files changed

+25
-25
lines changed

website/docs/en/config/server/open.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Open =
2323

2424
`server.open` can be set to the following values.
2525

26-
- Open the project's default preview page, which defaults to `http://localhost:<port>`. If [server.host](/config/server/host) is configured, it defaults to `http://<host>:<port>`.
26+
- Open the project's default preview page (`http://localhost:<port>`, or `http://<host>:<port>` if [server.host](/config/server/host) is configured).
2727

2828
```ts title="rsbuild.config.ts"
2929
export default {
@@ -75,7 +75,7 @@ export default {
7575

7676
## Port placeholder
7777

78-
The port number that Rsbuild server listens on may change. For example, if the port is in use, Rsbuild will automatically increment the port number until it finds an available port.
78+
The port number that Rsbuild server listens on may change. For example, if the port is already in use, Rsbuild will automatically increment the port number until it finds an available port.
7979

8080
To avoid `server.open` becoming invalid due to port changes, you can use one of the following methods:
8181

website/docs/en/guide/advanced/browser-compatibility.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Before dealing with compatibility issues, you first need to determine which brow
1010

1111
- If you haven't set browserslist yet, please read the [Browserslist](/guide/advanced/browserslist) chapter first.
1212

13-
- If you have set a browserslist, Rsbuild will automatically compile according to that scope, downgrade JavaScript syntax and CSS syntax, and inject the required polyfill. In most cases, you can safely use modern ECMAScript features without worrying about compatibility issues.
13+
- If you have set a browserslist, Rsbuild will automatically compile to match that scope, downgrade JavaScript and CSS syntax, and inject the required polyfills. In most cases, you can safely use modern ECMAScript features without worrying about compatibility issues.
1414

1515
After setting the browserslist, if you still encounter compatibility issues, please continue reading the content below to find solutions.
1616

website/docs/en/guide/advanced/env-vars.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default {
222222
223223
## `.env` file
224224
225-
When a `.env` file exists in the project root directory, Rsbuild CLI automatically uses [dotenv](https://npmjs.com/package/dotenv) to load these environment variables and add them to the current Node.js process. The [Public Variables](#public-variables) will be exposed in client code.
225+
When a `.env` file exists in the project root directory, Rsbuild CLI automatically uses [dotenv](https://npmjs.com/package/dotenv) to load these environment variables and add them to the current Node.js process. [Public Variables](#public-variables) will be exposed in client code.
226226
227227
You can access these environment variables through `import.meta.env.[name]` or `process.env.[name]`.
228228
@@ -233,13 +233,13 @@ Rsbuild supports reading the following types of env files:
233233
| File Name | Description |
234234
| ------------------------ | -------------------------------------------------------------------------- |
235235
| `.env` | Loaded by default in all scenarios. |
236-
| `.env.local` | Local usage of the `.env` file, should be added to .gitignore. |
236+
| `.env.local` | Local overrides for `.env`, should be added to `.gitignore`. |
237237
| `.env.development` | Read when `process.env.NODE_ENV` is `'development'`. |
238238
| `.env.production` | Read when `process.env.NODE_ENV` is `'production'`. |
239-
| `.env.development.local` | Local usage of the `.env.development` file, should be added to .gitignore. |
240-
| `.env.production.local` | Local usage of the `.env.production` file, should be added to .gitignore. |
239+
| `.env.development.local` | Local overrides for `.env.development`, should be added to `.gitignore`. |
240+
| `.env.production.local` | Local overrides for `.env.production`, should be added to `.gitignore`. |
241241
242-
If multiple of the above files exist, they will all be loaded, with files listed lower in the table having higher priority.
242+
If multiple of the above files exist, they will all be loaded. Files listed lower in the table have higher priority.
243243
244244
### Env mode
245245
@@ -251,7 +251,7 @@ For example, set the env mode as `test`:
251251
npx rsbuild dev --env-mode test
252252
```
253253
254-
Rsbuild will read these files in the following order and merge their contents. If the same environment variable is defined in multiple files, values from files loaded later will override those from files loaded earlier:
254+
Rsbuild will read these files in the following order and merge their contents. If the same environment variable is defined in multiple files, files loaded later will override those loaded earlier:
255255
256256
- .env
257257
- .env.local
@@ -275,7 +275,7 @@ For example, to specify the env directory as `config`:
275275
npx rsbuild dev --env-dir config
276276
```
277277
278-
In this case, Rsbuild will read the `./config/.env` and other env files.
278+
Rsbuild will then read `./config/.env` and other env files from that directory.
279279
280280
### Example
281281
@@ -361,7 +361,7 @@ console.log(process.env.PASSWORD); // -> undefined
361361
:::tip
362362
363363
- The content of public variables will be exposed to your client code, so please avoid including sensitive information in public variables.
364-
- Public variables are replaced through [source.define](/config/source/define). Please read ["Using define"](#using-define) to understand the principles and notes of define.
364+
- Public variables are replaced through [source.define](/config/source/define). Read ["Using define"](#using-define) to understand the principles and caveats of define.
365365
366366
:::
367367
@@ -471,10 +471,10 @@ export default {
471471
472472
If you use the above approach, it will cause the following problems:
473473
474-
1. Some unused environment variables are additionally injected, causing the dev server's environment variables to leak into the frontend code.
475-
2. Each `process.env` reference will be replaced by a complete environment variable object, increasing bundle size and decreasing performance.
474+
1. Unused environment variables are injected unnecessarily, causing the dev server's environment variables to leak into the frontend code.
475+
2. Every `process.env` reference will be replaced with the complete environment variable object, increasing bundle size and reducing performance.
476476
477-
Therefore, inject environment variables on `process.env` according to actual needs and avoid replacing it entirely.
477+
Therefore, only inject the specific environment variables you need on `process.env`, and avoid replacing it entirely.
478478
479479
## Type declarations
480480

website/docs/en/guide/framework/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To use SVGR, you also need to register the [SVGR plugin](/plugins/list/plugin-sv
4848

4949
Rsbuild uses React's official [Fast Refresh](https://npmjs.com/package/react-refresh) capability to perform component hot updates.
5050

51-
Note that React Refresh requires components to be written according to standards, otherwise HMR may not work. You can use [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) for validation.
51+
Note that React Refresh requires components to follow certain standards, otherwise HMR may not work. You can use [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) for validation.
5252

5353
For example, if React component hot updates don't work, or the component state is lost after hot updates, it's usually because your React component uses an anonymous function. React Fast Refresh requires that components cannot be anonymous functions, otherwise component state cannot be preserved after hot updates.
5454

website/docs/en/guide/optimization/build-performance.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This document provides optional optimization methods to improve build performanc
88

99
Performance profiling helps identify bottlenecks in your project, enabling targeted optimization.
1010

11-
Please refer to the [Build Performance Analysis](/guide/debug/build-profiling) section.
11+
See the [Build Performance Analysis](/guide/debug/build-profiling) section.
1212

1313
## General optimization
1414

@@ -30,13 +30,13 @@ Optimizing the number of modules referenced by the application reduces bundle si
3030

3131
When using Tailwind CSS v3, incorrectly configuring the `content` field in `tailwind.config.js` can lead to poor build and HMR performance.
3232

33-
Refer to [Tailwind CSS v3 - Optimize build performance](/guide/styling/tailwindcss-v3#optimize-build-performance) for more details.
33+
See [Tailwind CSS v3 - Optimize build performance](/guide/styling/tailwindcss-v3#optimize-build-performance) for more details.
3434

3535
### Parallel Less compilation
3636

3737
If your project uses the [@rsbuild/plugin-less](/plugins/list/plugin-less) plugin with a large number of Less files, you can try enabling parallel compilation to improve build performance.
3838

39-
Refer to [Less Plugin - parallel](/plugins/list/plugin-less#parallel) for more details.
39+
See [Less Plugin - parallel](/plugins/list/plugin-less#parallel) for more details.
4040

4141
### Tool selection
4242

@@ -62,7 +62,7 @@ export default {
6262
};
6363
```
6464

65-
> Refer to [dev.lazyCompilation](/config/dev/lazy-compilation) for more information.
65+
> See [dev.lazyCompilation](/config/dev/lazy-compilation) for more information.
6666
6767
### Enable native watcher
6868

website/docs/en/guide/optimization/code-splitting.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Rsbuild supports the following chunk splitting strategies:
1414

1515
- `split-by-experience`: an empirical splitting strategy, automatically splits some commonly used npm packages into chunks of moderate size.
1616
- `split-by-module`: split by NPM package granularity, each NPM package corresponds to a chunk.
17-
- `split-by-size`: automatically split according to module size.
17+
- `split-by-size`: automatically split based on module size.
1818
- `all-in-one`: bundle all codes into one chunk.
1919
- `single-vendor`: bundle all NPM packages into a single chunk.
2020
- `custom`: custom chunk splitting strategy.
2121

2222
::: tip
23-
When using strategies other than `all-in-one`, Rspack's default splitting rules will also take effect. For more details, please refer to [Rspack - SplitChunksPlugin](https://rspack.rs/plugins/webpack/split-chunks-plugin#default-behavior).
23+
When using strategies other than `all-in-one`, Rspack's default splitting rules will also take effect. For more details, see [Rspack - SplitChunksPlugin](https://rspack.rs/plugins/webpack/split-chunks-plugin#default-behavior).
2424
:::
2525

2626
## split-by-experience
@@ -238,7 +238,7 @@ export default {
238238
};
239239
```
240240

241-
The `override` config will be merged with Rspack's `splitChunks` config. For specific config details, please refer to [Rspack - splitChunks](https://rspack.rs/config/optimization#optimizationsplitchunks).
241+
The `override` config will be merged with Rspack's `splitChunks` config. For specific config details, see [Rspack - splitChunks](https://rspack.rs/config/optimization#optimizationsplitchunks).
242242

243243
## Using dynamic import for code splitting
244244

website/docs/en/guide/optimization/inline-assets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Inlining static assets refers to embedding the content of a static asset directly in an HTML or JS file, instead of linking to an external file. This can improve website performance by reducing the number of HTTP requests the browser needs to make to load the page.
44

5-
However, inlining static assets has some disadvantages, such as increasing the size of a single file, which may lead to slower loading. Therefore, you should decide whether to inline assets based on your specific situation.
5+
However, inlining static assets has some disadvantages, such as increasing the size of a single file, which may lead to slower loading. You should decide whether to inline assets based on your specific situation.
66

77
Rsbuild automatically inlines static assets smaller than 4KiB. Sometimes you may need to manually control whether assets are inlined. This document explains how to precisely control the inlining behavior of static assets.
88

website/docs/en/guide/optimization/optimize-bundle.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See the [performance.bundleAnalyze](/config/performance/bundle-analyze) configur
5252

5353
## Adjust browserslist
5454

55-
The Rsbuild will compile the code according to the project's Browserslist config, and inject some Polyfills. If the project does not need to be compatible with legacy browsers, you can adjust the Browserslist and drop some legacy browsers, thereby reducing the compilation overhead on syntax and polyfill.
55+
Rsbuild will compile the code based on the project's browserslist config and inject some polyfills. If your project doesn't need to support legacy browsers, you can adjust the browserslist to drop support for older browsers, reducing the compilation overhead for syntax transformation and polyfills.
5656

5757
Rsbuild's default Browserslist config is:
5858

website/docs/en/guide/styling/tailwindcss-v3.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
The above configuration is for reference only and can be modified to suit the needs of your project. For example, non-TypeScript projects do not need to include ts and tsx files.
4444
:::
4545

46-
It should be noted that the `content` option should include the paths to all source files that contain Tailwind class names. For details, please refer to [tailwindcss - Content Configuration](https://v3.tailwindcss.com/docs/content-configuration).
46+
Note that the `content` option should include the paths to all source files that contain Tailwind class names. For details, see [tailwindcss - Content Configuration](https://v3.tailwindcss.com/docs/content-configuration).
4747

4848
```js title="tailwind.config.js"
4949
/** @type {import('tailwindcss').Config} */

0 commit comments

Comments
 (0)