Skip to content

Instantly share code, notes, and snippets.

@a7ul
Created January 21, 2018 11:19
Show Gist options
  • Save a7ul/825fd008557e715c553c1bd01d29965b to your computer and use it in GitHub Desktop.
Save a7ul/825fd008557e715c553c1bd01d29965b to your computer and use it in GitHub Desktop.
Webpack config for electron + react apps
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, '../index.js'),
output: {
path: path.resolve(__dirname, '../build'),
filename: 'bundle.js'
},
devtool: 'eval',
devServer: {
compress: true,
port: 9000
},
target: 'electron',
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
}, {
test: /\.(png|jpg|gif|exe|bin)$/,
loader: 'file-loader',
options: {
name: '[path][name].[ext]'
}
}, {
test: /\.css$/,
use: [{
loader: 'style-loader'
},
{
loader: 'css-loader',
options: {
localIdentName: '[name]__[local]___[hash:base64:5]',
modules: true
}
}
]
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment