Skip to content

Interface: OutputChunk ​

The information about a chunk in the generated bundle.

Properties ​

code ​

  • Type: string

The generated code of this chunk.


dynamicImports ​

  • Type: string[]

External modules imported dynamically by this chunk.


exports ​

  • Type: string[]

Exported variable names from this chunk.


facadeModuleId ​

  • Type: string | null

The id of a module that this chunk corresponds to.


fileName ​

  • Type: string

The file name of this chunk.


immutable ​

  • Type: boolean

Whether this output is marked safe for long-term caching under its fileName.

The initial value is true when entryFileNames or chunkFileNames expands [hash] anywhere in the file name, including a directory part. This holds for string and function templates.

A prebuilt chunk starts with true when the plugin emits it with immutable: true.

The initial value is false for the following outputs.

  • templates that expand no [hash]
  • prebuilt chunks emitted without immutable: true
  • chunks emitted with type: 'chunk' and a fileName

Renaming a chunk in generateBundle clears the flag. A later assignment in the hook takes precedence.

A plugin that changes code in generateBundle without including the change in the hash must set immutable to false.


imports ​

  • Type: string[]

External modules imported statically by this chunk.


isDynamicEntry ​

  • Type: boolean

Whether this chunk is a dynamic entry point.


isEntry ​

  • Type: boolean

Whether this chunk is a static entry point.


map ​

The source map of this chunk if present.


moduleIds ​

  • Type: string[]

modules ​

Information about the modules included in this chunk.

Index Signature ​

[id: string]: RenderedModule


name ​

  • Type: string

The name of this chunk, which is used in naming patterns.


preliminaryFileName ​

  • Type: string

The preliminary file name of this chunk with hash placeholders.


sourcemapFileName ​

  • Type: string | null

type ​

  • Type: "chunk"

Was this page helpful?