text: const path = require('path');
  // eslint-disable-next-line
  const webpack = require('webpack');
  
  const { dependencies, devDependencies, build } = require('../package.json');
  
  const externals = Object.keys(dependencies).concat(
    Object.keys(devDependencies)
  );
  const isDevMode = process.env.NODE_ENV === 'development';
  const whiteListedModules = [];
  
  const config = {
    mode: process.env.NODE_ENV,
    devtool: isDevMode ? 'cheap-module-eval-source-map' : false,
    entry: {
      main: path.join(__dirname, '../src/main/index.js'),
    },
    externals: externals.filter(d => !whiteListedModules.includes(d)),
    module: {
      rules: [
        {
          enforce: 'pre',
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'eslint-loader',
        },
        {
          test: /\.js$/,
          use: 'babel-loader',
          exclude: /node_modules/,
        },
        {
          test: /\.node$/,
          use: 'node-loader',
        },
      ],
    },
    node: {
      __dirname: isDevMode,
      __filename: isDevMode,
    },
    plugins: [
      new webpack.DefinePlugin({
        'process.env.PRODUCT_NAME': JSON.stringify(build.productName),
      }),
    ],
    output: {
      filename: '[name].js',
      libraryTarget: 'commonjs2',
      path: path.join(__dirname, '../dist'),
    },
    resolve: {
      extensions: ['.js', '.json', '.node'],
    },
    target: 'electron-main',
  };
  
  module.exports = config;
  