title: How to read local html file content inside React js App using Webpack loaders?
body: <p>I am working on react js app and trying to read html file content locally. On specific condition I am passing file html data inside a variable like this::</p>
  <pre><code>let content = require(`../Designs/${data.path}.html`);
  </code></pre>
  <p>But it gives me error:</p>
  <blockquote>
  <p>Module parse failed: Unexpected token (1:0) You may need an
  appropriate loader to handle this file type, currently no loaders are
  configured to process this file.  See
  <a href="https://webpack.js.org/concepts#loaders" rel="nofollow noreferrer">https://webpack.js.org/concepts#loaders</a></p>
  </blockquote>
  <p>To resolve this I have created &quot;webpack.config.js&quot; file and installed webpack, html-loader. My is look like this:</p>
  <pre><code>const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
  const webpack = require('webpack'); //to access built-in plugins
  
  module.exports = {
      module: {
          rules: [
              {
                  test: /\.html$/,
                  use: [
                      {
                          loader: &quot;html-loader&quot;,
                          options: { minimize: true }
                      }
                  ]
              }
          ]
      },
      plugins: [
          new HtmlWebpackPlugin({
              template: './public/index.html',
          })
      ]
  };
  </code></pre>
  <p>Still I am getting same error. Please help or suggest something as I am new to webpack.</p>