BannerPlugin

BannerPlugin

Adds a banner to the top of each generated chunk.

new webpack.BannerPlugin(banner)
// or
new webpack.BannerPlugin(options)

Options

{
  banner: string, // the banner as string, it will be wrapped in a comment
  raw: boolean, // if true, banner will not be wrapped in a comment
  entryOnly: boolean, // if true, the banner will only be added to the entry chunks
  test: string | RegExp | Array,
  include: string | RegExp | Array,
  exclude: string | RegExp | Array,
}

Placeholders

Since webpack 2.5.0, placeholders are evaluated in the banner string:

new webpack.BannerPlugin({
  banner: "hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file]"
})

Further Reading

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/plugins/banner-plugin

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部