{}
Inject content into the top of each JS, CSS or DTS file.
string
undefined
Inject content into the top of each JS file.
string
undefined
Inject content into the top of each CSS file.
string
undefined
Inject content into the top of each DTS file.
The banner content in JS/CSS file is based on the BannerPlugin of Rspack. You should notice the following points:
raw: true
is enabled by default, so the banner content will be injected as a raw string instead of wrapping in a comment. So if you want to inject a comment, you should add /*
and */
or other comment syntax by yourself.stage
option is set to the stage after the JavaScript and CSS files are optimized, thus preventing the banner content from being optimized away.If the above default settings cannot meet your requirements, you can customize the banner content through tools.rspack.plugins
to add a BannerPlugin instance with the corresponding options.
The banner content in DTS files is handled differently from JS/CSS files. It is written directly using the file system API, so setting BannerPlugin
will not affect it.