Skip to content

Commit

Permalink
docs: Update example for template parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dudekaa authored and jantimon committed Jan 2, 2020
1 parent bf017f3 commit 40b410e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions examples/template-parameters/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ module.exports = {
},
plugins: [
new HtmlWebpackPlugin({
templateParameters: {
'foo': 'bar'
// NOTE if you pass plain object it will be passed as is. no default values there, so be aware!
// for implementation detail, please see index.js and search for "userOptions" variable
templateParameters: (compilation, assets, assetTags, options) => {
return {
compilation,
webpackConfig: compilation.options,
htmlWebpackPlugin: {
tags: assetTags,
files: assets,
options
},
'foo': 'bar'
};
},
template: 'index.ejs'
})
Expand Down

0 comments on commit 40b410e

Please sign in to comment.