close
Skip to content

sourcemapFileNames

  • Type: string | ((chunkInfo) => string)
  • Optional

The pattern to use for sourcemaps created from entry points, or a function that is called per entry chunk with PreRenderedChunk 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.
  • [hash]: A hash based only on the content of the final generated sourcemap. 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.
  • [chunkhash]: The same hash as the one used for the corresponding generated chunk (if any).
  • [name]: The name of the corresponding chunk.

Forward slashes (/) can be used to place files in sub-directories. This pattern will also be used for every file when setting the output.preserveModules option.

See also output.assetFileNames, output.chunkFileNames.

Default

the corresponding chunk filename with .map appended

Was this page helpful?