---
url: /reference/OutputOptions.chunkFileNames.md
---
# chunkFileNames

* **Type**: `string` | ((`chunkInfo`) => `string`)
* **Optional**

The pattern to use for naming shared chunks created when code-splitting, or a function that is called per chunk with [`PreRenderedChunk`](Interface.PreRenderedChunk.md) to return such a pattern.

Patterns support the following placeholders:

* `[format]`: The rendering format defined in the output options. The value is any of [`InternalModuleFormat`](TypeAlias.InternalModuleFormat.md).
* `[hash]`: A hash based only on the content of the final generated chunk, including transformations in `renderChunk` and any referenced file hashes. You can also set a specific hash length via e.g. `[hash:10]`. By default, it will create a base-64 hash. If you need a reduced character set, see [`output.hashCharacters`](./OutputOptions.hashCharacters).
* `[name]`: The name of the chunk. This can be explicitly set via the [`output.codeSplitting`](./OutputOptions.codeSplitting) option or when the chunk is created by a plugin via `this.emitFile`. Otherwise, it will be derived from the chunk contents.

Forward slashes (`/`) can be used to place files in sub-directories.

See also [`output.assetFileNames`](./OutputOptions.assetFileNames), [`output.entryFileNames`](./OutputOptions.entryFileNames).

## Default

```ts
'[name]-[hash].js'
```
