On this page

Prepends or appends banner text to emitted assets that match the configured file filters.

new BannerPlugin(options): BannerPlugin
Attributes
options object

Normalizes banner options and compiles the configured banner source into a function that can render per-asset banner text.

  • banner {(data: { chunk: Chunk; filename: string; hash?: string }) => string}
  • options <BannerPluginOptions>
apply(compiler): void
Attributes
compiler:<Compiler>
the compiler instance
Returns:<void>

Validates the configured options and injects rendered banner comments into matching compilation assets at the configured process-assets stage.

Type:
{string | BannerPluginOptions | ((data: { chunk: Chunk; filename: string; hash?: string }) => string)}