Skip to content

BannerPlugin: add doc on placeholders #1230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion content/plugins/banner-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]"
})
```