title: How do I use a nunjucks file as an entry point with webpack?
body: <p>I've seen this post with <a href="https://stackoverflow.com/questions/39063450/webpack-html-ejs-include-other-templates">ejs</a>. But how do I achieve the same with webpack?</p>
  
  <p>I tried using the nunjucks-loader in conjunction with <code>html-webpack-plugin</code>, but I get the following error: <code>[nunjucks-loader] non-web targets are not supported</code>.</p>
  
  <p>Here's my code:</p>
  
  <p>Here's the config:</p>
  
  <pre><code>const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
    //template: './client/index.html',
    filename: 'index.html',
    inject: 'body',
    template: 'nunjucks-html-loader!./client/templates/index.njk',
  });
  
  module: {
      loaders: [
        {
          test: /\.html$/,
          use: ['html-loader']
        }, 
        {
          test: /\.|njk|nunjucks$/,
          use: ['nunjucks-loader']
        }]
    };
  </code></pre>