Created
January 21, 2018 11:19
-
-
Save a7ul/825fd008557e715c553c1bd01d29965b to your computer and use it in GitHub Desktop.
Webpack config for electron + react apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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