Skip to content

chunkFileNames

  • Type: optional chunkFileNames: string | (chunkInfo) => string

The pattern to use for naming shared chunks created when code-splitting, or a function that is called per chunk to return such a pattern.

Patterns support the following placeholders:

  • [format]: The rendering format defined in the output options, e.g. es or cjs.
  • [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.
  • [name]: The name of the chunk. This can be explicitly set via the output.advancedChunks 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, output.entryFileNames.

Default

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

Released under the MIT License.