title: html-webpack-plugin Entrypoint undefined = index.html
body: <p>I'm trying to set a webpack4 and React boilerplate, but facing issue rendering the index.html. For example, when I updated the title of the index.html and the index.html in /dist folder is not updated, and only title is rendered while nothing in index.js is rendered. Please help take a look with below details in my project. </p>
  
  <p>package.json</p>
  
  <pre><code>{
    "name": "react-webpack-boilerplate",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "start": "webpack-dev-server --mode development --open --hot",
      "build": "webpack --mode production"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "babel-core": "^6.26.3",
      "babel-loader": "^7.1.4",
      "babel-preset-env": "^1.7.0",
      "babel-preset-react": "^6.24.1",
      "css-loader": "^0.28.11",
      "html-loader": "^0.5.5",
      "html-webpack-plugin": "^3.2.0",
      "redux-immutable-state-invariant": "1.2.3",
      "style-loader": "^0.21.0",
      "webpack": "^4.6.0",
      "webpack-cli": "^2.0.15",
      "webpack-dev-server": "^3.1.4"
    },
    "dependencies": {
      "bootstrap": "^4.1.1",
      "react": "^16.3.2",
      "react-bootstrap": "^0.32.1",
      "react-dom": "^16.3.2",
      "react-redux": "^5.0.7",
      "react-router": "2.4.0",
      "react-router-redux": "4.0.4",
      "redux": "3.5.2",
      "redux-thunk": "2.0.1"
    }
  }
  </code></pre>
  
  <p>webpack.config.js:</p>
  
  <pre><code>// state rules for babel loader
  
  // This plugin will generate html files with scripts injected 
  const HtmlWebPackPlugin = require("html-webpack-plugin");
  
  const htmlPlugin = new HtmlWebPackPlugin({
    template: "./src/index.html",
    filename: "./index.html"
  });
  
  module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader" // it will look for .babelrc
        }
      },
      {
        test: /\.html$/,
        use: [
          {
            loader: "html-loader"
          }
        ]
      },
      {
        test: /\.css$/,
       use: [
          {
            loader: "style-loader"
          },
          {
            loader: "css-loader",
            options: {
              modules: true,
              importLoaders: 1,
              localIdentName: "[name]_[local]_[hash:base64]",
              sourceMap: true,
              minimize: true
            }
          }
        ]
      },
      {
          test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
              loader: 'url-loader',
              options: {
              limit: 10000
              }
          }
      }
    ]
  },
  plugins: [htmlPlugin]
  };
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;React 2&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;section id="index"&gt;&lt;/section&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>index.js:</p>
  
  <pre><code>import React from "react";
  import {ReactDOM} from 'react-dom';
  
  console.log('loading index js');
  const App = () =&gt; {
      return (
        &lt;div&gt;
          &lt;h3&gt;Our Application Is Alive&lt;/h3&gt;
          &lt;p&gt;This isn’t reality. This — is fantasy.&lt;/p&gt;
          &lt;p&gt;Yes I am quoting Star Trek I cant help it.&lt;/p&gt;
        &lt;/div&gt;
      );
    };
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('index'));
  </code></pre>
  
  <p>After build, the ./dist/index.html is not updated, see  content:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;React and Webpack4&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;section id="index"&gt;&lt;/section&gt;
  &lt;script type="text/javascript" src="main.js"&gt;&lt;/script&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>below are found in compilation message:</p>
  
  <pre><code>Child html-webpack-plugin for "index.html":
       1 asset
      Entrypoint undefined = index.html
      [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 
  327 bytes {0} [built]
  </code></pre>