Interface: EmittedAsset
Either a name or a fileName can be supplied. If a fileName is provided, it will be used unmodified as the name of the generated file, throwing an error if this causes a conflict. Otherwise, if a name is supplied, this will be used as substitution for [name] in the corresponding output.assetFileNames pattern, possibly adding a unique number to the end of the file name to avoid conflicts. If neither a name nor fileName is supplied, a default name will be used.
Properties
fileName?
- Type:
string - Optional
immutable?
- Type:
boolean - Optional
Whether fileName contains a content hash, so the file can be cached long-term.
Pass true when the plugin writes a hashed fileName itself. Without it, the output asset reports immutable: false.
Only used with fileName. For an asset named by assetFileNames, the output asset is true when the template expands [hash].
Default
falsename?
- Type:
string - Optional
originalFileName?
- Type:
string - Optional
An absolute path to the original file if this asset corresponds to a file on disk.
This property will be passed on to subsequent plugin hooks that receive a PreRenderedAsset or an OutputAsset like generateBundle. In watch mode, Rolldown will also automatically watch this file for changes and trigger a rebuild if it changes. Therefore, it is not necessary to call this.addWatchFile for this file.
source
- Type:
string|Uint8Array<ArrayBufferLike>
type
- Type:
"asset"