Skip to content

Interface: OutputAsset ​

The information about an asset in the generated bundle.

Properties ​

fileName ​

  • Type: string

The file name of this asset.


immutable ​

  • Type: boolean

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

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

An asset emitted with a fileName starts with true when the plugin passes immutable: true.

The initial value is false for the following outputs.

  • templates that expand no [hash]
  • assets emitted with a fileName but without immutable: true
  • sourcemaps generated by Rolldown, even when sourcemapFileNames expands [hash]

Renaming an asset in generateBundle clears the flag. A later assignment in the hook takes precedence.

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


name ​

  • Type: string | undefined

Deprecated ​

Use names instead.


names ​

  • Type: string[]

originalFileName ​

  • Type: string | null

Deprecated ​

Use originalFileNames instead.


originalFileNames ​

  • Type: string[]

The list of the absolute paths to the original file of this asset.


source ​

  • Type: string | Uint8Array<ArrayBufferLike>

The content of this asset.


type ​

  • Type: "asset"

Was this page helpful?