title: Webpack 4: how to copy a json file while adding a hash to the name, and link it in index.html
body: <p>I'm upgrading to Webpack 4 from Webpack 3.
  In index.html I have the following:</p>
  
  <pre><code>&lt;link rel="manifest" href="&lt;%= require('!file-loader?name=[path][name]-[hash:6].[ext]!static/manifest') %&gt;"&gt;
  </code></pre>
  
  <p>However it had stopped working after the upgrade. The compilation fails saying:</p>
  
  <blockquote>
    <p>Module parse failed: Unexpected token m in JSON at position 0 while parsing near 'module.exports = __w...'</p>
  </blockquote>
  
  <p>Seems like Webpack is trying to parse the json file (possibly twice) which is not what I need (the documentation mentions json files are now being parsed by default).
  Not sure if this change of behavior in 'require' + file-loader is by design or a bug. Trying to use !!file-loader yields the same result.</p>
  
  <p>Another option could be to use copy-webpack-plugin with [hash] but then how to link to the new name in index.html?</p>