Skip to content

Commit 1ac7ee2

Browse files
authored
docs: improve filename configuration (#4719)
1 parent 99fc988 commit 1ac7ee2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ Sets the filename of output files.
4747

4848
After the production build, Rsbuild will add a hash in the middle of the filename by default. If you don't need to add it, you can set [output.filenameHash](/config/output/filename-hash) to `false` to disable this behavior.
4949

50+
:::tip
51+
Rsbuild will generate the final file path based on `output.filename` and [output.distPath](/config/output/dist-path).
52+
53+
See [Output files](/guide/basic/output-files) for more information.
54+
55+
:::
56+
5057
## File types
5158

5259
`output.filename` can be set differently for different file types.
@@ -62,8 +69,6 @@ Here are the details of each `output.filename` option:
6269
- `media`: The name of media assets, such as video.
6370
- `assets`: The name of other static assets. Such as the assets defined in [Extend Asset Types](/guide/basic/static-assets#extend-asset-types).
6471

65-
> See [Output files](/guide/basic/output-files) for more information.
66-
6772
## Example
6873

6974
To set the name of the JavaScript files to `[name]_script.js`:

website/docs/zh/config/output/filename.mdx

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ const prodDefaultFilename = {
4747

4848
在生产模式构建后,Rsbuild 会自动在文件名中间添加 hash 值,如果不需要添加,可以将 [output.filenameHash](/config/output/filename-hash) 设置为 `false` 来禁用该行为。
4949

50+
:::tip
51+
Rsbuild 会基于 `output.filename`[output.distPath](/config/output/dist-path) 来生成最终的文件路径。
52+
53+
查看 [构建产物目录](/guide/basic/output-files) 了解更多。
54+
55+
:::
56+
5057
## 文件类型
5158

5259
`output.filename` 可以为不同类型的文件设置不同的名称。
@@ -62,8 +69,6 @@ const prodDefaultFilename = {
6269
- `media`:视频等媒体资源的名称。
6370
- `assets`:其他静态资源的名称。例如 [扩展静态资源类型](/guide/basic/static-assets#扩展静态资源类型) 中定义的资源。
6471

65-
> 查看 [构建产物目录](/guide/basic/output-files) 了解更多。
66-
6772
## 示例
6873

6974
修改 JavaScript 文件的名称为 `[name]_script.js`

0 commit comments

Comments
 (0)