2017-12-04 20:45:18 +01:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const ELECTRON_RENDERER_PROCESS_ROOT = path.resolve(__dirname, 'src/renderer/');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
// This rule is temporarily necessary until https://github.com/electron-userland/electron-webpack/issues/60 is fixed.
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['env', 'react', 'stage-2']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
// This allows imports to be made from the renderer process root (https://moduscreate.com/blog/es6-es2015-import-no-relative-path-webpack/).
|
|
|
|
resolve: {
|
|
|
|
modules: [ELECTRON_RENDERER_PROCESS_ROOT, 'node_modules', __dirname],
|
|
|
|
extensions: ['.js', '.jsx', '.scss']
|
2017-12-09 14:23:40 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
const FLOW_BABEL_WEBPACK_PLUGIN = require('./src/renderer/flowtype-plugin');
|
|
|
|
|
|
|
|
module.exports.plugins = [
|
|
|
|
new FLOW_BABEL_WEBPACK_PLUGIN({
|
2017-12-07 21:03:12 +01:00
|
|
|
warn: true
|
|
|
|
})
|
|
|
|
]
|
2017-12-09 14:23:40 +01:00
|
|
|
}
|