https://github.com/webrecorder/webrecorder-player
Raw File
Tip revision: 8442abc0f56e506bebc4f47b296fc3569711accf authored by mark f beasley on 05 August 2019, 18:41:23 UTC
Update icons with player branding, submodule update (#85)
Tip revision: 8442abc
webpack.config.js
/**
 * Webpack config for production electron main process
 */

import webpack from 'webpack';
import path from 'path';
import BabiliPlugin from 'babili-webpack-plugin';

const projectDir = path.resolve(__dirname, '../');


export default {
  target: 'electron-main',

  entry: 'main.dev',

  module: {
    rules: [{
      test: /\.jsx?$/,
      exclude: /node_modules/,
      use: {
        loader: 'babel-loader',
        options: {
          cacheDirectory: true
        }
      }
    }]
  },

  output: {
    path: path.join(projectDir, 'app'),
    filename: 'main.prod.js'
  },

  resolve: {
    extensions: ['.js', '.jsx', '.json'],
    modules: [
      path.join(projectDir, 'app'),
      'node_modules',
    ],
  },

  plugins: [
    /**
     * Babli is an ES6+ aware minifier based on the Babel toolchain (beta)
     */
    new BabiliPlugin(),

    /**
     * Create global constants which can be configured at compile time.
     *
     * Useful for allowing different behaviour between development builds and
     * release builds
     *
     * NODE_ENV should be production so that modules do not perform certain
     * development checks
     */
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
      'process.env.DEBUG_PROD': JSON.stringify(process.env.DEBUG_PROD || 'false')
    })
  ],

  /**
   * Disables webpack processing of __dirname and __filename.
   * If you run the bundle in node.js it falls back to these values of node.js.
   * https://github.com/webpack/webpack/issues/2010
   */
  node: {
    __dirname: false,
    __filename: false
  },
};
back to top