Replace variables extension for the HTML Webpack Plugin
This is an extension plugin for the webpack plugin html-webpack-plugin - a plugin that can replace variables in server template
Install the plugin with npm:
$ npm install html-webpack-replace-var-plugin
Require the plugin in your webpack config:
var HtmlWebpackReplaceVarPlugin = require('html-webpack-replace-var-plugin');
Add the plugin to your webpack config as follows:
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackReplaceVarPlugin()
]
The above configuration will actually do nothing due to the configuration defaults.
you can set options like this:
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackReplaceVarPlugin({
'<%': '{{',
'%>': '}}'
})
]