title: htmlWebPack plugin publicPath not working as expected
body: <p>My webpack output:</p>
  
  <pre><code>output: {
      publicPath: path.join(basename, '/assets/'),
      path: `${__dirname}/built/core/assets/`,
      filename: '[name].[chunkhash].js',
  },
  </code></pre>
  
  <p>index.html template:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;% for (var chunk in htmlWebpackPlugin.files.chunks) { %&gt;
  &lt;script charset="utf-8" src="&lt;%= htmlWebpackPlugin.files.chunks[chunk].entry %&gt;"&gt;&lt;/script&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>Now the problem is when the publicPath is set to <code>path.join(basename, '/assets')</code>, then index.html is resolved to:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script charset="utf-8" src="\assets/bundle.d121bf175aece5f14af6.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>which is ok, however because i haven't added trailing slash to public path, in bundle.[hash].js file, chunks</p>
  
  <pre class="lang-js prettyprint-override"><code>script.src = __webpack_require__.p + "" + chunkId + "." + {"0":"24692a7f9ff51c72880c...
  ...
  __webpack_require__.p = "\\assets";
  </code></pre>
  
  <p>are resolved to <code>assets[id].[hash].js</code> without slash and they're not found. However if i add trailing comma to publicPath(<code>path.join(basename, '/assets/')</code>) then the index.html is resolved to</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script charset="utf-8" src="\assets\/bundle.d121bf175aece5f14af6.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and bundle.[hash].js file is not found then.</p>
  
  <p>What am i missing in config?</p>