1.0.2 • Published 7 years ago

refresh-browser-webpack-plugin v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

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

  1. Add the plugin to the plugins array.
  2. 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()
      ]
    };