website/docs/en/plugins/webpack/banner-plugin.mdx
import { Table } from '@builtIns';
new rspack.BannerPlugin(options);
Adds a banner to the top or bottom of each generated chunk.
type BannerFunction = (args: {
hash: string;
chunk: Chunk;
filename: string;
}) => string;
type BannerContent = string | BannerFunction;
type BannerPluginOptions = {
banner: BannerContent;
entryOnly?: boolean;
footer?: boolean;
raw?: boolean;
stage?: number;
test?: BannerRules;
include?: BannerRules;
exclude?: BannerRules;
};
type BannerPluginArgument = BannerContent | BannerPluginOptions;
undefinedAdd a banner to the bottom of each chunk file.
import { rspack } from '@rspack/core';
export default {
plugins: [
new rspack.BannerPlugin({
banner: 'hello world',
footer: true,
}),
],
};