<repo_name>tebeco/electron-starters<file_sep>/electron-ts/src/gui.ts
document.getElementsByTagName('body')[0].innerHTML = `node Version: ${process.versions.node}`;
<file_sep>/electron-ts/webpack.config.ts
require('ts-node/register');

const path = require('path')

const commonConfig = {
  node: {
    __dirname: false
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        enforce: 'pre',
        loader: 'tslint-loader',
        options: {
          typeCheck: true,
          emitErrors: true
        }
      },
      {
        test: /\.tsx?$/,
        loader: 'ts-loader'
      }
    ]
  },
  resolve: {
    extensions: ['.ts', '.json']
  }
}

const HtmlWebpackPlugin = require('html-webpack-plugin');

const config = [
  {
    ...commonConfig,
    ...{
      target: 'electron-main',
      entry: { main: './src/main.ts' }
    }
  },
  {
    ...commonConfig,
    ... {
      target: 'electron-renderer',
      entry: { gui: './src/gui.ts' },
      plugins: [new HtmlWebpackPlugin()]
    }
  }
];

export default config;
<file_sep>/electron-ts-webpack/webpack.config.ts
require('ts-node/register');

import { resolve } from 'path';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';

const commonConfig = {
  node: {
    __dirname: false
  },
  output: {
    path: resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        enforce: 'pre',
        loader: 'tslint-loader',
        options: {
          typeCheck: true,
          emitErrors: true
        }
      },
      {
        test: /\.tsx?$/,
        loader: 'ts-loader'
      }
    ]
  },
  resolve: {
    extensions: ['.ts', '.json']
  }
}

const config = [
  {
    ...commonConfig,
    ...{
      target: 'electron-main',
      entry: { main: './electron/main.ts' }
    }
  },
  {
    ...commonConfig,
    ... {
      target: 'electron-renderer',
      entry: { gui: './src/main.ts' },
      plugins: [new HtmlWebpackPlugin()]
    }
  }
];

export default config;
