> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# html.favicon

- **类型：** `string ｜ Function`
- **默认值：** `undefined`

设置页面的 favicon 图标，可以设置为：

- URL 地址。
- 文件的绝对路径。
- 相对于项目根目录的相对路径。

配置该选项后，在编译过程中会自动将图标拷贝至 dist 目录下，并在 HTML 中添加相应的 `link` 标签。

:::info
该配置项的使用方式与 Rsbuild 完全一致。详细信息请参考 [Rsbuild - html.favicon](https://v2.rsbuild.dev/zh/config/html/favicon)。
:::