text: const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const TerserJSPlugin = require('terser-webpack-plugin');
  const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  const CompressionPlugin = require('compression-webpack-plugin');
  const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
  
  
  module.exports = {
    entry: './src/index.ts',
    devtool: 'source-map',
    output: {
      filename: '[name].[contenthash:8].js',
      path: path.resolve(__dirname, 'dist')
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/
        },
        {
          test: /\.css$/,
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                publicPath: './'
              }
            },
            'css-loader'
          ]
        },
        {
          test: /\.(png|svg|jpg|jpeg|gif)$/,
          use: [ 'file-loader' ]
        },
        {
          test: /\.(woff|woff2|eot|ttf|otf)$/,
          use: [ 'file-loader' ]
         },
         {
          test: /\.(weights)$/,
          use: [ 'file-loader' ]
         }
      ]
    },
    resolve: {
      extensions: [ '.tsx', '.ts', '.js' ]
    },
    plugins: [
      new CleanWebpackPlugin(),
      new FaviconsWebpackPlugin({
        logo: './src/assets/shaka.png',
        persistentCache: true,
        inject: true,
        icons: {
          android: false,
          appleIcon: false,
          appleStartup: false,
          coast: false,
          favicons: true,
          firefox: false,
          opengraph: false,
          twitter: false,
          yandex: false,
          windows: false
        }
      }),
      new MiniCssExtractPlugin({
        filename: 'style.css'
      }),
      new HtmlWebpackPlugin({
        template: 'src/index.html',
        inject: 'body',
        inlineSource: '.(js|css)$'
      }),
      new HtmlWebpackInlineSourcePlugin(),
      new BundleAnalyzerPlugin({
        analyzerMode: 'static',
        openAnalyzer: false
      }),
      new CompressionPlugin({
        test: /\.js(\?.*)?$/i
      })
    ],
    optimization: {
      minimizer: [
        new TerserJSPlugin({
          sourceMap: true
        }),
        new OptimizeCSSAssetsPlugin({})
      ],
      splitChunks: {
        cacheGroups: {
          vendors: false // Disable it for better bundle anaylzing
        }
      }
    },
    devServer: {
      compress: true,
      contentBase: './dist',
      host: '0.0.0.0'
    }
  };
  