text: const HtmlWebpackPlugin = require('html-webpack-plugin')
  const TerserPlugin = require("terser-webpack-plugin")
  
  module.exports = {
    entry: `${__dirname}/src/index.tsx`,
    target: 'web',
    output: {
      path: `${__dirname}/dist/`,
      filename: '[name].js',
      libraryTarget: 'umd'
    },
    resolve: {
      extensions: ['.tsx', '.ts', '.jsx', '.js', '.scss', '.sass', '.css']
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: 'ts-loader',
          exclude: /node_modules/
        },
        {
          test: /\.jsx?$/,
          loader: 'babel-loader'
        },
        {
            test: /\.gz$/,
            use: 'arraybuffer-loader'
        }
      ]
    },
    optimization: {
      minimize: true,
      minimizer: [
        new TerserPlugin({
          terserOptions: {
            format: {
              comments: false,
            },
          },
          extractComments: false,
        }),
      ],
      splitChunks: {
        name: 'lib',
        chunks: 'all',
      }
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: 'src/index.html'
      })
    ]
  }