refresh-browser-webpack-plugin
A webpack plugin, refresh browser when the HTML files generated by html-webpack-plugin changes.When you use html-webpack-plugin to create multi-page applications, once the template files changes, refresh your browser.
It can be used with webpack-dev-server webpack-hot-middleware.
To monitor html-webpack-plugin's html-webpack-plugin-after-html-processing hook.
installation
install the plugin with npm:
$ npm install --save-dev refresh-browser-webpack-plugin
Basic usage
- Add the plugin to the plugins array.
- Add 'refresh-browser-webpack-plugin/client' into the entry array.
var HtmlWebpackPlugin = require('html-webpack-plugin');
var RefreshBrowserPlugin = require('refresh-browser-webpack-plugin');
var webpackConfig = {
entry: {
index: ['refresh-browser-webpack-plugin/client', 'index.js']
},
output: {
path: 'dist',
filename: 'index.js'
},
plugins: [
new HtmlWebpackPlugin(),
new RefreshBrowserPlugin()
]
};