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/config/dev/asset-prefix.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ Set the URL prefix of static assets in [development mode](/config/mode).
7
7
8
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.
9
9
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.
11
11
12
12
## Default value
13
13
14
14
The default value of `dev.assetPrefix` is the same as [server.base](/config/server/base).
15
15
16
16
When `server.base` is `/foo`, `index.html` and other static assets can be accessed through `http://localhost:3000/foo/`.
17
17
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:
Copy file name to clipboardExpand all lines: website/docs/en/config/output/asset-prefix.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@
3
3
-**Type:**`string | 'auto'`
4
4
-**Default:**[server.base](/config/server/base)
5
5
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.
7
7
8
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.
9
9
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.
11
11
12
12
## Example
13
13
@@ -54,7 +54,7 @@ The default value of `output.assetPrefix` is the same as [server.base](/config/s
54
54
55
55
When `server.base` is `/foo`, `index.html` and static assets can be accessed through `http://localhost:3000/foo/`.
56
56
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:
58
58
59
59
```ts
60
60
exportdefault {
@@ -71,12 +71,12 @@ export default {
71
71
72
72
assetPrefix can be set to the following types of paths:
73
73
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/`.
76
76
-**'auto'**: Rspack will automatically calculate the path and generate relative paths based on file location.
77
77
78
78
:::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.
Copy file name to clipboardExpand all lines: website/docs/en/config/output/inline-scripts.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Setting `inlineScripts: true` is equivalent to setting [inlineScripts.enable](#e
67
67
68
68
### Script tag position
69
69
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'`.
71
71
72
72
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>`.
Copy file name to clipboardExpand all lines: website/docs/en/config/resolve/alias.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Set the alias for the module path, which is used to simplify the import path or
21
21
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).
22
22
23
23
:::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.
Copy file name to clipboardExpand all lines: website/docs/en/config/source/transform-import.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,7 +237,7 @@ export default {
237
237
};
238
238
```
239
239
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.
0 commit comments