text: const path = require('path')
  const HtmlWebpackPlugin = require('html-webpack-plugin')
  
  module.exports = {
    resolve: {
      extensions: ['.tsx', '.ts', '.js'],
      mainFields: ['main', 'module', 'browser'],
    },
    entry: './react/src/app.tsx',
    target: 'electron-renderer',
    devtool: 'source-map',
    module: {
      rules: [
        {
          test: /\.(js|ts|tsx)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
          },
        },
      ],
    },
    devServer: {
      contentBase: path.join(__dirname, './react/dist'),
      historyApiFallback: true,
      compress: true,
      hot: true,
      port: 4000,
      publicPath: '/',
    },
    output: {
      path: path.resolve(__dirname, './react/dist'),
      filename: 'js/[name].js',
      publicPath: './',
    },
    plugins: [
      new HtmlWebpackPlugin(),
    ],
  }
  