title: Custom loader before HtmlWebpackPlugin causes "Unexpected token" error
body: <p>I'm working on making a custom loader that's going to take the HTML template specified for HtmlWebpackPlugin, perform some alterations, and then pass it along.</p>
  <p>To start, I made a loader that echos what it is given:</p>
  <pre><code>//loader.js
  
  module.exports = function(fileContent){
    return fileContent
  }
  </code></pre>
  <p>But this results in the following error:</p>
  <pre><code>Html Webpack Plugin:
    Error: Child compilation failed:
    Module parse failed: Unexpected token (1:0)
    File was processed with these loaders:
     * ./node_modules/html-webpack-plugin/lib/loader.js
     * ./loader.js
  </code></pre>
  <p>The HTML file is just for testing, it looks like this:</p>
  <pre><code>//index.html
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;body&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I'm not sure why such an error would happen. I looked at the source code for the HtmlWebpackPlugin and tried logging what it receives to the console, but it's the exact same as what I return in <code>loader.js</code>.</p>
  <p>I tried giving it a plain string to see what would happen, like this:</p>
  <pre><code>//loader.js
  
  module.exports = function(fileContent){
    return &quot;test&quot;
  }
  </code></pre>
  <p>But then it tells me:</p>
  <pre><code>HtmlWebpackPlugin
  ReferenceError: test is not defined
   - loader.js:1 eval
  //...and so on
  </code></pre>
  <p>Huh? So I guess it's trying to evaluate what I give it? I'm not sure what's going on. Any help is appreciated.</p>
  <p>Here is the <a href="https://github.com/jantimon/html-webpack-plugin/blob/master/lib/loader.js" rel="nofollow noreferrer">loader code</a> for HtmlWebpackPlugin:</p>