text: /* eslint-disable @typescript-eslint/no-var-requires */
  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: path.resolve(rootPath, 'src/render/index.tsx'),
    target: 'electron-renderer',
    devtool: 'source-map',
    module: {
      rules: [
        {
          test: /\.(js|ts|tsx)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader'
          }
        }
      ]
    },
    devServer: {
      contentBase: path.join(rootPath, 'dist/renderer'),
      historyApiFallback: true,
      compress: true,
      hot: true,
      host: '0.0.0.0',
      port: 4000,
      publicPath: '/'
    },
    output: {
      path: path.resolve(rootPath, 'dist/renderer'),
      filename: 'js/[name].js',
      publicPath: './'
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: path.resolve(rootPath, 'src/render/index.html')
      })
    ]
  }
  