text: const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  
  const rootPath = path.resolve(__dirname, '..');
  
  module.exports = {
    resolve: {
      extensions: ['.tsx', '.ts', '.js'],
      mainFields: ['main', 'module', 'browser'],
    },
    entry: [
      'regenerator-runtime/runtime',
      path.resolve(rootPath, 'src', 'index.tsx'),
    ],
    target: 'electron-renderer',
    devtool: 'source-map',
    module: {
      rules: [
        {
          test: /\.(js|ts|tsx)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
          },
        },
        {
          test: /\.(png|jpg|gif)$/i,
          use: [
            {
              loader: 'url-loader',
              options: {
                limit: 8192,
              },
            },
          ],
        },
      ],
    },
    devServer: {
      port: 4000,
      publicPath: '/',
      compress: true,
      noInfo: false,
      stats: 'errors-only',
      inline: true,
      lazy: false,
      hot: true,
      headers: { 'Access-Control-Allow-Origin': '*' },
      contentBase: path.join(rootPath, 'dist/renderer'),
      watchOptions: {
        aggregateTimeout: 300,
        ignored: /node_modules/,
        poll: 100,
      },
      historyApiFallback: {
        verbose: true,
        disableDotRule: false,
      },
    },
    output: {
      path: path.resolve(rootPath, 'dist/renderer'),
      filename: 'js/[name].js',
      publicPath: './',
    },
    plugins: [new HtmlWebpackPlugin()],
  };
  