title: How to config Webpack build to get assets generated in public folder?
body: <p>When I build my project using webpack, it publishes all files in dist folder. I want HTML file and asset files to be published in public folder. How do I configure webpack to achieve this?</p>
  
  <p>webpack.config.js</p>
  
  <pre><code>const HtmlWebPackPlugin = require("html-webpack-plugin");
  
  module.exports = {
    module: {
      rules: [
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: {
            loader: "babel-loader"
          }
        },
        {
          test: /\.html$/,
          use: [
            {
              loader: "html-loader",
              options: { minimize: true }
            }
          ]
        },
        {
          test: /\.css$/,
          use: [
            'style-loader',
            'css-loader'
          ]
        },
        {
          test: /\.(png|svg|jpg|gif)$/,
          use: [
            'file-loader'
          ]
        },
        {
          test: /\.(woff|woff2|eot|ttf|otf)$/,
          use: [
            'file-loader'
          ]
        }
      ]
    },
    plugins: [
      new HtmlWebPackPlugin({
        template: "./src/index.html",
        filename: "./index.html"
      })
    ]
  };
  </code></pre>