Skip to content

Commit ccaf29e

Browse files
Copilotchenjiahan
andauthored
docs: improve documentation authenticity and natural flow (#6051)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: chenjiahan <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent 6a4e05c commit ccaf29e

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Set the URL prefix of static assets in [development mode](/config/mode).
77

88
`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.
99

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

1212
## Default value
1313

1414
The default value of `dev.assetPrefix` is the same as [server.base](/config/server/base).
1515

1616
When `server.base` is `/foo`, `index.html` and other static assets can be accessed through `http://localhost:3000/foo/`.
1717

18-
It should be noted that when customizing the `dev.assetPrefix` option, if you want static assets to be normally accessible through the Rsbuild dev server, `dev.assetPrefix` should contain the same URL prefix as `server.base`, such as:
18+
It should be noted that when customizing the `dev.assetPrefix` option, if you want static assets to be normally accessible through the Rsbuild dev server, `dev.assetPrefix` should contain the same URL prefix as `server.base`. For example:
1919

2020
```ts
2121
export default {

website/docs/en/config/html/meta.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type MetaOptions = {
3232

3333
When the `value` of a `meta` object is a string, the `key` of the object is automatically mapped to `name`, and the `value` is mapped to `content`.
3434

35-
For example to set description:
35+
To set a description, for example:
3636

3737
```js
3838
export default {
@@ -69,7 +69,7 @@ When the `value` of a `meta` object is an object, the `key: value` of the object
6969

7070
In this case, the `name` and `content` properties will not be set by default.
7171

72-
For example to set `charset`:
72+
To set `charset`, for example:
7373

7474
```js
7575
export default {
@@ -149,7 +149,7 @@ export default {
149149

150150
Setting the `value` of the `meta` object to `false` means the meta tag will not be generated.
151151

152-
For example to remove the `viewport`:
152+
To remove the `viewport`, for example:
153153

154154
```ts
155155
export default {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
- **Type:** `string | 'auto'`
44
- **Default:** [server.base](/config/server/base)
55

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

88
`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 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.
10+
This configuration is only used in `production` mode or `none` mode. In `development` mode, use [dev.assetPrefix](/config/dev/asset-prefix) to configure the URL prefix.
1111

1212
## Example
1313

@@ -54,7 +54,7 @@ The default value of `output.assetPrefix` is the same as [server.base](/config/s
5454

5555
When `server.base` is `/foo`, `index.html` and static assets can be accessed through `http://localhost:3000/foo/`.
5656

57-
It should be noted that when customizing the `output.assetPrefix` option, if you want static assets to be accessible normally during [Rsbuild preview](/guide/basic/cli#rsbuild-preview), `output.assetPrefix` should contain the same URL prefix as `server.base`, such as:
57+
It should be noted that when customizing the `output.assetPrefix` option, if you want static assets to be accessible normally during [Rsbuild preview](/guide/basic/cli#rsbuild-preview), `output.assetPrefix` should contain the same URL prefix as `server.base`. For example:
5858

5959
```ts
6060
export default {
@@ -71,12 +71,12 @@ export default {
7171

7272
assetPrefix can be set to the following types of paths:
7373

74-
- **absolute path**: This is the most common practice, can be specific server paths, like `/assets/`, or setting to CDN paths, like `https://cdn.example.com/assets/`.
75-
- **relative path**: such as `./assets/`.
74+
- **absolute path**: This is the most common practice, which can be specific server paths like `/assets/`, or CDN paths like `https://cdn.example.com/assets/`.
75+
- **relative path**: For example, `./assets/`.
7676
- **'auto'**: Rspack will automatically calculate the path and generate relative paths based on file location.
7777

7878
:::tip
79-
It's not recommended to set assetPrefix as a relative path, such as `'./assets/'`. This is because when assets are at different path depths, using relative paths may cause assets to load incorrectly.
79+
It's not recommended to set assetPrefix as a relative path like `'./assets/'`. This is because when assets are at different path depths, using relative paths may cause assets to load incorrectly.
8080
:::
8181

8282
## Compare with `publicPath`

website/docs/en/config/output/inline-scripts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Setting `inlineScripts: true` is equivalent to setting [inlineScripts.enable](#e
6767

6868
### Script tag position
6969

70-
When `output.inlineScripts` is used, it is recommended to set [html.inject](/config/html/inject) to `'body'`.
70+
When using `output.inlineScripts`, we recommend setting [html.inject](/config/html/inject) to `'body'`.
7171

7272
As the default injection position of the script tag is the `<head>` tag, changing the injection position to the `<body>` tag can ensure that the inlined script can access the DOM elements in `<body>`.
7373

website/docs/en/config/resolve/alias.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Set the alias for the module path, which is used to simplify the import path or
2121
For TypeScript projects, you only need to configure [compilerOptions.paths](https://typescriptlang.org/tsconfig#paths) in the `tsconfig.json` file. Rsbuild will automatically recognize it, so there is no need to configure the `resolve.alias` option separately. For more details, please refer to [Path Aliases](/guide/advanced/alias).
2222

2323
:::tip
24-
In versions prior to Rsbuild 1.1.7, you can use the `source.alias` to set alias, but it will be removed in the next major version.
24+
In versions prior to Rsbuild 1.1.7, you can use `source.alias` to set alias, but it will be removed in the next major version.
2525
:::
2626

2727
## Basic usage

website/docs/en/config/source/transform-import.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export default {
237237
};
238238
```
239239

240-
In addition, you can also declare the format of the path after transformation, such as setting it to `my-lib/{{ camelCase member }}` to convert member into camel case.
240+
In addition, you can also declare the format of the path after transformation, for example setting it to `my-lib/{{ camelCase member }}` to convert member into camel case.
241241

242242
The following formats are supported:
243243

website/docs/en/guide/basic/html-template.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Rsbuild defaults to setting the charset and viewport meta tags:
122122
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
123123
```
124124

125-
You can also add custom meta tags, such as setting the description:
125+
You can also add custom meta tags, like a description:
126126

127127
```ts
128128
export default {

0 commit comments

Comments
 (0)