diff --git a/content/plugins/banner-plugin.md b/content/plugins/banner-plugin.md index e88de1b8896f..ee3f79262967 100644 --- a/content/plugins/banner-plugin.md +++ b/content/plugins/banner-plugin.md @@ -2,15 +2,20 @@ title: BannerPlugin contributors: - simon04 +related: + - title: banner-plugin-hashing test + url: https://github.com/webpack/webpack/blob/master/test/configCases/plugins/banner-plugin-hashing/webpack.config.js + --- +Adds a banner to the top of each generated chunk. + ``` javascript new webpack.BannerPlugin(banner) // or new webpack.BannerPlugin(options) ``` -Adds a banner to the top of each generated chunk. ## Options @@ -24,3 +29,14 @@ Adds a banner to the top of each generated chunk. exclude: string | RegExp | Array, } ``` + + +## Placeholders + +Since webpack 2.5.0, placeholders are evaluated in the `banner` string: + +```javascript +new webpack.BannerPlugin({ + banner: "hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file]" +}) +```