lbry-desktop/webpack.renderer.additions.js

33 lines
908 B
JavaScript
Raw Normal View History

const Path = require('path');
const FlowFlowPlugin = require('./flowtype-plugin');
2017-12-04 20:45:18 +01:00
const ELECTRON_RENDERER_PROCESS_ROOT = Path.resolve(__dirname, 'src/renderer/');
2017-12-04 20:45:18 +01:00
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',
2017-12-04 20:45:18 +01:00
options: {
presets: ['env', 'react', 'stage-2'],
},
},
],
2017-12-04 20:45:18 +01:00
},
// 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'],
},
};
if (process.env.NODE_ENV === 'development') {
module.exports.plugins = [
new FlowFlowPlugin({
warn: true,
}),
];
}