Update readme with template content documentation

This commit is contained in:
Charles Blaxland 2014-08-14 21:29:21 +10:00
parent 0f15aee3e2
commit 0b89ce7d20
1 changed files with 13 additions and 0 deletions

View File

@ -137,6 +137,19 @@ To use this template, configure the plugin like this:
}
```
Alternatively, if you already have your template's content in a String, you
can pass it to the plugin using the `templateContent` option:
```javascript
plugins: [
new HtmlWebpackPlugin({
templateContent: templateContentString
})
]
```
Note the plugin will throw an error if you specify both `template` _and_
`templateContent`.
The `o` variable in the template is the data that is passed in when the
template is rendered. This variable has the following attributes:
- `htmlWebpackPlugin`: data specific to this plugin