text: const webpack = require('webpack');
  const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  
  const config = {
      entry: ['react-hot-loader/patch', './src/index.tsx'],
      output: {
          path: path.resolve(__dirname, 'dist'),
          filename: 'bundle.js',
          publicPath: '/',
      },
      module: {
          rules: [
              {
                  test: /\.(js|jsx)$/,
                  use: 'babel-loader',
                  exclude: /node_modules/,
              },
              {
                  test: /\.css$/,
                  use: ['style-loader', 'css-loader'],
              },
              {
                  test: /\.ts(x)?$/,
                  loader: 'ts-loader',
                  exclude: /node_modules/,
              },
              {
                  test: /\.(scss|sass)$/,
                  use: ['style-loader', 'css-loader', 'sass-loader'],
              },
              {
                  test: /\.png$/,
                  use: [
                      {
                          loader: 'url-loader',
                          options: {
                              mimetype: 'image/png',
                          },
                      },
                  ],
              },
          ],
      },
      resolve: {
          extensions: ['.js', '.jsx', '.tsx', '.ts'],
          alias: {
              'react-dom': '@hot-loader/react-dom',
          },
      },
      devServer: {
          historyApiFallback: true,
          contentBase: './dist',
      },
      plugins: [
          new HtmlWebpackPlugin({
              template: path.resolve('src') + '/index.html',
              filename: 'index.html',
          }),
      ],
  };
  
  module.exports = config;
  