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

# output.filename.template

> `optional` **template?**: `string`

:::info 仅适用于 Rspeedy
此配置仅由 Rspeedy 的 `lynx.config.ts` 接受，Rsbuild + `pluginLynx` 不支持。请勿直接写入 `rsbuild.config.ts`，也不要传给 `pluginLynx()`。
:::

模板文件的名称。

## Deprecated

请使用 [Filename.bundle](/next/zh/api/packages/rspeedy/interfaces/Filename.md#bundle) 代替。

## Default Value

`'[name].[platform].bundle'`

## Remarks

支持以下占位符：

- `[name]`：入口名称。
- `[contenthash]`：模板的 contenthash。

## Examples

- 在 bundle 文件名中使用 content hash：

```js
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  output: {
    filename: {
      template: '[name].[contenthash].bundle',
    },
  },
})
```

- 在 bundle 文件名中使用指定长度的 content hash：

```js
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  output: {
    filename: {
      template: '[name].[contenthash:8].bundle',
    },
  },
})
```
