Skip to content

Commit 729ac91

Browse files
Copilotchenjiahan
andcommitted
docs: improve English clarity in 5 documentation files
Co-authored-by: chenjiahan <7237365+chenjiahan@users.noreply.github.com>
1 parent d071454 commit 729ac91

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

website/docs/en/guide/advanced/environments.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Rsbuild supports building outputs for multiple environments at the same time. Yo
44

55
## What is environment
66

7-
The `environment` refers to the runtime environment for build output. Common environments include browsers, Node.js, and Workers. Rsbuild allows you to define any environment names and set build options for each environment individually.
7+
The `environment` refers to the runtime environment for build output. Common environments include browsers, Node.js, and Workers. Rsbuild allows you to define custom environment names and set build options for each environment individually.
88

99
A typical scenario is server-side rendering (SSR). You can define two environments, `web` and `node`, where the build targets ([output.target](/config/output/target)) are `web` and `node`. These are used for client-side rendering (CSR) and server-side rendering (SSR) scenarios.
1010

@@ -13,15 +13,15 @@ You can also define different environments for the same build target, for exampl
1313
- Define `rsc` and `ssr` environments, both targeting `node`, used separately for React Server Components and SSR.
1414
- Define `desktop` and `mobile` environments, both targeting `web`, used separately for desktop and mobile browsers.
1515

16-
Without the `environments` configuration, you would need to define multiple configurations for these scenarios and run multiple independent Rsbuild builds. Now, with the `environments` configuration, you can complete the build for multiple outputs in a single Rsbuild run (Rsbuild achieves this using Rspack's [MultiCompiler](https://rspack.rs/api/javascript-api/compiler#multicompiler)).
16+
Without the `environments` configuration, you would need to define multiple configurations for these scenarios and run multiple independent Rsbuild builds. With the `environments` configuration, you can complete the build for multiple outputs in a single Rsbuild run (Rsbuild achieves this using Rspack's [MultiCompiler](https://rspack.rs/api/javascript-api/compiler#multicompiler)).
1717

1818
In Rsbuild, each `environment` is associated with an Rsbuild configuration, an Rspack configuration, and a set of build outputs. Rsbuild plugin developers can customize the build process for a specified environment based on the `environment` name, such as modifying Rsbuild or Rspack configurations, registering or removing plugins, adjusting Rspack rules, and viewing assets information.
1919

2020
## Environment configs
2121

2222
Rsbuild supports defining different Rsbuild configurations for each environment through [environments](/config/environments).
2323

24-
For example, if your project wants to support the SSR function, you need to define different configurations for client and SSR respectively. You can define web and node environments.
24+
For example, if your project needs SSR support, you need to define different configurations for the client and server. You can define web and node environments.
2525

2626
```ts title="rsbuild.config.ts"
2727
export default {
@@ -77,7 +77,7 @@ Then, Rsbuild will use these environment configurations to internally generate t
7777

7878
### Debug config
7979

80-
When you execute the command `npx rsbuild inspect` in the project root directory, you will find the following output:
80+
When you execute the command `npx rsbuild inspect` in the project root directory, you will see the following output:
8181

8282
- `rsbuild.config.[name].mjs`: The Rsbuild config used for a certain environment during build.
8383
- `rspack.config.[name].mjs`: The Rspack config corresponding to a certain environment when building.
@@ -95,7 +95,7 @@ config inspection completed, generated files:
9595

9696
## Default environment
9797

98-
When environments is not specified, Rsbuild will by default create an environment with the same name based on the currently target type (the value of [output.target](/config/output/target)).
98+
When environments is not specified, Rsbuild creates an environment by default with the same name as the current target type (the value of [output.target](/config/output/target)).
9999

100100
```ts title="rsbuild.config.ts"
101101
export default {

website/docs/en/guide/advanced/hmr.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Hot module replacement
22

3-
Hot Module Replacement (HMR) exchanges, adds, or removes modules while an application runs, without a full reload. This significantly speeds up development in several ways:
3+
Hot Module Replacement (HMR) exchanges, adds, or removes modules while an application is running, without a full page reload. This significantly speeds up development in several ways:
44

5-
- Retain application state that is lost during a full reload.
6-
- Save valuable development time by updating only what changed.
7-
- Instantly update the browser when modifying CSS / JS in source code, almost comparable to changing styles directly in the browser's dev tools.
5+
- Preserves application state that would be lost during a full reload.
6+
- Saves valuable development time by updating only what changed.
7+
- Instantly updates the browser when modifying CSS/JS in source code, similar to changing styles directly in the browser's dev tools.
88

99
## HMR toggle
1010

@@ -20,7 +20,7 @@ export default {
2020
};
2121
```
2222

23-
To disable both HMR and live reload, set both [dev.hmr](/config/dev/hmr) and [dev.liveReload](/config/dev/live-reload) to `false`. Then, no WebSocket requests will be made from the page to the dev server, and the page won't automatically refresh when files change.
23+
To disable both HMR and live reload, set both [dev.hmr](/config/dev/hmr) and [dev.liveReload](/config/dev/live-reload) to `false`. This prevents WebSocket requests from the page to the dev server, and the page won't automatically refresh when files change.
2424

2525
```ts title="rsbuild.config.ts"
2626
export default {
@@ -50,9 +50,9 @@ export default {
5050

5151
## File watching
5252

53-
By default, Rsbuild doesn't watch files in the `.git/` and `node_modules/` directories. When files in these directories change, Rsbuild won't trigger a rebuild. This reduces memory usage and improves build performance.
53+
By default, Rsbuild doesn't watch files in the `.git/` and `node_modules/` directories. When files in these directories change, Rsbuild won't trigger a rebuild, which reduces memory usage and improves build performance.
5454

55-
If you want to watch these directories, you can manually configure Rspack's [watchOptions.ignored](https://rspack.rs/config/watch#watchoptionsignored) to override the default behavior.
55+
If you want to watch these directories, manually configure Rspack's [watchOptions.ignored](https://rspack.rs/config/watch#watchoptionsignored) to override the default behavior.
5656

5757
For example, to watch the `node_modules/` directory and ignore the `.git/` directory, you can configure it as follows:
5858

website/docs/en/guide/advanced/ssr.mdx

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

33
This chapter introduces how to implement SSR functionality using Rsbuild.
44

5-
Please note that Rsbuild itself does not provide out-of-the-box SSR functionality, but instead provides low-level APIs and configurations to allow framework developers to implement SSR. If you require out-of-the-box SSR support, you may consider using full-stack frameworks based on Rsbuild, such as [Modern.js](https://github.com/web-infra-dev/modern.js).
5+
Please note that Rsbuild itself does not provide out-of-the-box SSR functionality, but provides low-level APIs and configurations to allow framework developers to implement SSR. If you need out-of-the-box SSR support, consider using full-stack frameworks based on Rsbuild, such as [Modern.js](https://github.com/web-infra-dev/modern.js).
66

77
## What is SSR
88

99
SSR stands for "Server-Side Rendering". It means that the HTML of the web page is generated by the server and sent to the client, rather than sending only an empty HTML shell and relying on JavaScript to generate the page content.
1010

11-
In traditional client-side rendering, the server sends an empty HTML shell and some JavaScript scripts to the client, then fetches data from the server's API and fills the page with dynamic content. This leads to slow initial page loading times and is not conducive to user experience and SEO.
11+
In traditional client-side rendering, the server sends an empty HTML shell and some JavaScript scripts to the client, which then fetches data from the server's API and fills the page with dynamic content. This leads to slow initial page loading times and negatively impacts user experience and SEO.
1212

13-
With SSR, the server generates HTML that already contains dynamic content and sends it to the client. This makes the initial page loading faster and more SEO-friendly, as search engines can crawl the rendered page.
13+
With SSR, the server generates HTML that already contains dynamic content and sends it to the client. This makes initial page loading faster and more SEO-friendly, as search engines can crawl the rendered page.
1414

1515
## File structure
1616

website/docs/en/guide/basic/server.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Rsbuild includes a built-in dev server that enhances the development experience.
66

77
By default, the Rsbuild server's base path is `/`. You can access output files like `index.html` and [public folder](/guide/basic/static-assets#public-folder) assets at `http://localhost:3000/`.
88

9-
You can modify the server's base path using [server.base](/config/server/base). For example, to access files at `http://localhost:3000/foo/`, configure it as follows:
9+
Modify the server's base path using [server.base](/config/server/base). For example, to access files at `http://localhost:3000/foo/`, configure it as follows:
1010

1111
```ts title="rsbuild.config.ts"
1212
export default {
@@ -18,7 +18,7 @@ export default {
1818

1919
## View static assets
2020

21-
After starting the dev server, you can access `/rsbuild-dev-server` to view all static assets generated during the current build.
21+
After starting the dev server, access `/rsbuild-dev-server` to view all static assets generated during the current build.
2222

2323
For example, open `http://localhost:3000/rsbuild-dev-server` in your browser:
2424

@@ -36,9 +36,9 @@ The Rsbuild server provides default routing conventions and allows customization
3636

3737
The Rsbuild server generates page routes based on the [server.base](/config/server/base) and [source.entry](/config/source/entry) configurations.
3838

39-
When the entry is `index`, you can access the page at `/`. When the entry is `foo`, you can access the page at `/foo`.
39+
When the entry is `index`, access the page at `/`. When the entry is `foo`, access the page at `/foo`.
4040

41-
When `server.base` is `/base`, you can access the index page at `/base`, and the foo page at `/base/foo`.
41+
When `server.base` is `/base`, access the index page at `/base`, and the foo page at `/base/foo`.
4242

4343
```ts title="rsbuild.config.ts"
4444
export default {
@@ -60,7 +60,7 @@ If a request meets the following conditions but no corresponding static asset is
6060

6161
### Custom fallback behavior
6262

63-
If Rsbuild's default [server.htmlFallback](/config/server/html-fallback) configuration doesn't meet your needs (for example, if you want to access `main.html` when accessing `/`), you can configure it using [server.historyApiFallback](/config/server/history-api-fallback).
63+
If Rsbuild's default [server.htmlFallback](/config/server/html-fallback) configuration doesn't meet your needs (for example, to access `main.html` when accessing `/`), configure it using [server.historyApiFallback](/config/server/history-api-fallback).
6464

6565
```ts title="rsbuild.config.ts"
6666
export default {
@@ -80,11 +80,11 @@ export default {
8080

8181
### HTML output path
8282

83-
Normally, `/` points to the dist root directory, and HTML files are output to the dist root directory. In this case, you can access HTML pages at `/some-path`.
83+
Normally, `/` points to the dist root directory, and HTML files are output to the dist root directory. In this case, access HTML pages at `/some-path`.
8484

8585
If you output HTML files to other subdirectories by modifying [output.distPath.html](/config/output/dist-path), you need to access HTML pages at `/[htmlPath]/some-path`.
8686

87-
For example, if you set HTML files to output to the `HTML` directory, you can access index.html at `/html/`, and foo.html at `/html/foo`.
87+
For example, if you set HTML files to output to the `HTML` directory, access index.html at `/html/`, and foo.html at `/html/foo`.
8888

8989
```ts
9090
export default {
@@ -191,7 +191,7 @@ server.middlewares.use((req, res, next) => {
191191

192192
When migrating from other server frameworks (such as Express), the original middleware may not work directly in Rsbuild. For example, Express-specific properties like `req.params`, `req.path`, `req.search`, and `req.query` are not available in Rsbuild middleware.
193193

194-
If you need to reuse existing middleware in Rsbuild, you can integrate the entire server application as middleware using the following approach:
194+
To reuse existing middleware in Rsbuild, integrate the entire server application as middleware using the following approach:
195195

196196
```ts title="rsbuild.config.ts"
197197
import express from 'express';
@@ -213,6 +213,6 @@ export default {
213213

214214
## Custom server
215215

216-
If you want to integrate Rsbuild's dev server into a custom server, you can use the `createDevServer` method to get the Rsbuild dev server instance and call its methods as needed.
216+
To integrate Rsbuild's dev server into a custom server, use the `createDevServer` method to get the Rsbuild dev server instance and call its methods as needed.
217217

218218
For details, refer to [Rsbuild - createDevServer](/api/javascript-api/instance#rsbuildcreatedevserver).

website/docs/en/guide/basic/static-deploy.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This section introduces how to deploy the build outputs of Rsbuild as a static s
44

55
## Background information
66

7-
Before starting the deployment, you should understand some background information:
7+
Before starting the deployment, you should understand the following:
88

99
- The CLI commands used for building and previewing outputs.
1010
- The directory structure of the build outputs.
@@ -15,7 +15,7 @@ Before starting the deployment, you should understand some background informatio
1515
The build commands provided by Rsbuild are:
1616

1717
- [build command](/guide/basic/cli#rsbuild-build), used to generate the build outputs for production deployment.
18-
- [preview command](/guide/basic/cli#rsbuild-preview), used to preview the production build outputs locally. Note that you need to execute the `rsbuild build` command beforehand to generate the build outputs.
18+
- [preview command](/guide/basic/cli#rsbuild-preview), used to preview the production build outputs locally. Note that you must first execute the `rsbuild build` command to generate the build outputs.
1919

2020
```json title="package.json"
2121
{
@@ -50,7 +50,7 @@ We can divide the build output into two parts: **HTML files** and **static asset
5050
- HTML files refer to files with the `.html` suffix in the output directory, which usually need to be deployed on the server.
5151
- Static assets are located in the `static` directory of the output folder, which contains assets such as JavaScript, CSS, and images. They can be deployed either on the server or on a CDN.
5252

53-
If the static assets are deployed in a subdirectory of the server, you can set [output.assetPrefix](/config/output/asset-prefix) as the base path:
53+
If the static assets are deployed in a subdirectory of the server, set [output.assetPrefix](/config/output/asset-prefix) as the base path:
5454

5555
```ts title="rsbuild.config.ts"
5656
import { defineConfig } from '@rsbuild/core';
@@ -62,7 +62,7 @@ export default defineConfig({
6262
});
6363
```
6464

65-
If you want to place these static assets on a CDN for better performance rather than directly on the server with the HTML, you will need to set [output.assetPrefix](/config/output/asset-prefix) to the CDN address to ensure the application can properly reference these static assets.
65+
If you want to place these static assets on a CDN for better performance rather than directly on the server with the HTML, set [output.assetPrefix](/config/output/asset-prefix) to the CDN address to ensure the application can properly reference these static assets.
6666

6767
```ts title="rsbuild.config.ts"
6868
import { defineConfig } from '@rsbuild/core';
@@ -92,12 +92,12 @@ The following sections describe how to deploy on several common platforms.
9292

9393
You can follow the [Cloudflare Pages - Git integration guide](https://developers.cloudflare.com/pages/get-started/git-integration/) to integrate with Git and deploy your site to Cloudflare Pages.
9494

95-
When configuring, you need to fill in the following fields under "Build settings":
95+
When configuring, fill in the following fields under "Build settings":
9696

9797
- **Build command**: fill in the project's build command, typically `npm run build`.
9898
- **Build output directory**: fill in the project's output directory, which defaults to `dist`.
9999

100-
Then click on the **Save and Deploy** button to start the deployment.
100+
Then click the **Save and Deploy** button to start the deployment.
101101

102102
### GitHub pages
103103

0 commit comments

Comments
 (0)