const webpack = require('webpack'); const path = require('path'); const nodeEnv = process.env.NODE_ENV || 'development'; const isProd = nodeEnv === 'production'; module.exports = { devtool: isProd ? 'hidden-source-map' : 'cheap-eval-source-map', entry: './index.js', output: { path: path.join(__dirname, './dist'), filename: 'bundle.js' }, module: { loaders: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, loaders: [ 'babel-loader' ] }, { test: /\.json/, loader: 'json-loader' }, { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(), new webpack.ExternalsPlugin('commonjs', ['electron']) ] };