Interface: Filename
The Filename determines the name of the Lynx bundle files emitted under Output.distPath.
Remarks
If a string is provided, it will be used as Filename.bundle.
Properties
assets?
optionalassets?:Filename
The name of other assets, except for above (image, svg, font, html, wasm...)
Default Value
'[name].[contenthash:8][ext]'
bundle?
optionalbundle?:BundleFilename
The name of the bundle files.
Remarks
The following placeholders are supported:
[name]: the name of the entry.[platform]: the name of the Rsbuild environment.[contenthash]: the hash of the bundle content.
Default Value
'[name].[platform].bundle'
Examples
- Using content hash in bundle filename:
- Using content hash with length in bundle filename:
- Using a function to control the main bundle and the lazy bundles separately (e.g. emit lazy bundles into another directory with a git commit hash appended):
css?
optionalcss?:Filename
Lynx Default Changed
The name of the CSS files.
Default Value
'[name]/[name].css'
Example
- Using a function to dynamically set the filename based on the file information:
font?
optionalfont?:Filename
The name of the font files.
Default Value
'[name].[contenthash:8][ext]'
image?
optionalimage?:Filename
The name of non-SVG images.
Default Value
'[name].[contenthash:8][ext]'
js?
optionaljs?:Filename
The name of the JavaScript files.
Default Value
'[name].js' in development, '[name].[contenthash:8].js' in production web builds, and '[name].js' in production node builds
Example
- Using a function to dynamically set the filename based on the file information:
media?
optionalmedia?:Filename
The name of media assets, such as video.
Default Value
'[name].[contenthash:8][ext]'
svg?
optionalsvg?:Filename
The name of the SVG images.
Default Value
'[name].[contenthash:8].svg'
template?
optionaltemplate?:string
The name of the template files.
Deprecated
Use Filename.bundle instead.
Default Value
'[name].[platform].bundle'
Remarks
The following placeholder is supported:
[name]: the name of the entry.[contenthash]: the contenthash of the template.
Examples
- Using content hash in bundle filename:
- Using content hash with length in bundle filename:
wasm?
optionalwasm?:string
The name of WebAssembly files.
Default Value
'[contenthash:8].module.wasm'