const TerserPlugin = require('terser-webpack-plugin');
const { resolve } = require('path');

module.exports = (_env, _argv) => ({
  mode: 'production',
  target: 'node',
  entry: './renderer/src/setup/index.js',
  output: {
    filename: 'setup.bundle.js',
    path: resolve(__dirname, '..', '..', '..', 'dist')
  },
  resolve: {
    extensions: [ '.js' ]
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        extractComments: false,
        terserOptions: {
          keep_classnames: true,
          compress: {
            drop_debugger: false
          },
          format: {
            comments: false
          }
        }
      })
    ]
  }
});
