浮声新志

webpack插件篇:BannerPlugin详解

用途说明

BannerPlugin ()

Adds a banner to the top of each generated chunk.

  • banner a string, it will be wrapped in a comment

  • options.raw if true, banner will not be wrapped in a comment

  • options.entryOnly if true, the banner will only be added to the entry chunks.

webpack.config.js配置

1
new webpack.BannerPlugin(banner, options)

案例

1
2