text: const HtmlWebpackPlugin = require("html-webpack-plugin");
  const { CheckerPlugin } = require('awesome-typescript-loader');
  const path = require("path");
  
  const basePath = __dirname;
  
  module.exports = {
    context: path.join(basePath, 'src'),
    resolve: {
      alias: {
        common: path.resolve(__dirname, './src/common'),
        core: path.resolve(__dirname, './src/core'),
        router: path.resolve(__dirname, './src/router'),
        pods: path.resolve(__dirname, './src/pods'),
        layouts: path.resolve(__dirname, './src/layouts'),
        pages: path.resolve(__dirname, './src/pages'),
        img: path.resolve(__dirname, './src/img'),
      },
      extensions: ['.js', '.ts', '.jsx', '.tsx'],
    },
    entry: {
      app: ['regenerator-runtime/runtime', './main.tsx'],
    },
    optimization: {
      splitChunks: {
        cacheGroups: {
          vendor: {
            chunks: 'all',
            name: 'vendor',
            test: /[\\/]node_modules[\\/]/,
            enforce: true,
          },
        },
      },
    },
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: './js/[name].[chunkhash].js',
    },
    module: {
      rules: [
        {
          test: /\.(tsx?)$/,
          exclude: /node_modules/,
          loader: 'awesome-typescript-loader',
          options: {
            useBabel: true,
            useCache: true,
            babelCore: '@babel/core',
          },
        },
        {
          test: /\.jsx?$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
        },
        {
          test: /\.html$/,
          loader: 'html-loader',
        },
      ],
    },
    plugins: [
      new HtmlWebpackPlugin({
        filename: 'index.html',
        template: './index.html',
      }),
      new CheckerPlugin(),
    ],
  };