2016-07-16 02:06:10 +00:00
|
|
|
import path from 'path';
|
2016-09-15 22:45:08 +00:00
|
|
|
import pkg from '../app/package.json';
|
2016-03-16 05:49:42 +00:00
|
|
|
|
2016-04-20 02:14:53 +00:00
|
|
|
export default {
|
2016-03-22 05:01:58 +00:00
|
|
|
devtool: 'source-map',
|
2016-03-16 20:02:47 +00:00
|
|
|
context: path.join(__dirname, '../app'),
|
|
|
|
entry: [
|
2016-11-30 03:55:27 +00:00
|
|
|
'./renderer.js',
|
|
|
|
'./renderer.html'
|
2016-03-16 20:02:47 +00:00
|
|
|
],
|
|
|
|
output: {
|
2016-07-18 20:10:18 +00:00
|
|
|
path: path.join(__dirname, '../build'),
|
2016-04-20 02:14:53 +00:00
|
|
|
filename: 'bundle.js',
|
|
|
|
libraryTarget: 'commonjs2'
|
2016-03-16 20:02:47 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
id: 'babel',
|
2016-10-02 20:57:00 +00:00
|
|
|
test: /\.js$/,
|
2016-04-03 22:54:39 +00:00
|
|
|
loaders: ['babel'],
|
2016-10-02 20:57:00 +00:00
|
|
|
exclude: [/node_modules/, /__fixtures__/, /__tests__/]
|
2016-03-16 20:02:47 +00:00
|
|
|
},
|
2016-04-16 23:24:57 +00:00
|
|
|
{
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json'
|
|
|
|
},
|
2016-03-16 20:02:47 +00:00
|
|
|
{
|
2016-08-29 17:58:59 +00:00
|
|
|
test: /\.(less|css)$/,
|
|
|
|
loader: 'style!css!less'
|
2016-03-16 20:02:47 +00:00
|
|
|
},
|
|
|
|
{
|
2016-04-16 23:24:57 +00:00
|
|
|
test: /\.html$/,
|
2016-03-16 20:02:47 +00:00
|
|
|
loader: "file?name=[name].[ext]"
|
|
|
|
},
|
2017-01-20 21:54:03 +00:00
|
|
|
{
|
|
|
|
test: /\.png$/,
|
|
|
|
loader: "file"
|
|
|
|
},
|
2016-04-20 02:14:53 +00:00
|
|
|
{
|
|
|
|
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
loader: "file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
loader: "url?limit=10000&mimetype=image/svg+xml"
|
|
|
|
},
|
2016-03-16 20:02:47 +00:00
|
|
|
{
|
|
|
|
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
loader: "url?limit=10000&mimetype=application/font-woff"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
loader: "url?limit=10000&mimetype=application/font-woff"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
loader: "url?limit=10000&mimetype=application/octet-stream"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
2016-04-16 23:24:57 +00:00
|
|
|
extensions: ['', '.js', '.json', '.jsx'],
|
2016-03-22 18:20:05 +00:00
|
|
|
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
|
2016-04-15 16:50:29 +00:00
|
|
|
},
|
2016-04-20 06:09:46 +00:00
|
|
|
externals: [
|
2016-10-02 20:57:00 +00:00
|
|
|
// Omit all dependencies in app/package.json (we want them loaded at runtime via NodeJS)
|
2016-04-27 03:17:05 +00:00
|
|
|
...Object.keys(pkg.dependencies)
|
2016-04-20 02:14:53 +00:00
|
|
|
],
|
2016-04-20 06:09:46 +00:00
|
|
|
plugins: [],
|
2016-04-20 02:14:53 +00:00
|
|
|
target: 'electron-renderer'
|
2016-03-16 20:02:47 +00:00
|
|
|
};
|