Check out example codes for "html webpack plugin". It will help you in understanding the concepts better.

Code Example 1

//installation
npm install --save-dev html-webpack-plugin

//configuration
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');

module.exports = {
  entry: 'index.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'index_bundle.js'
  },
  plugins: [new HtmlWebpackPlugin({
      template: "./index.html",
    })]
};

Code Example 2

npm install html-webpack-plugin --save-dev

Code Example 3

  npm i --save-dev html-webpack-plugin

Learn ReactJs, React Native from akashmittal.com