Skip to content

Commit

Permalink
Configure electron-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
IGassmann committed Dec 4, 2017
1 parent 127b773 commit 6982fc5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions electron-webpack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"renderer": {
"webpackConfig": "webpack.renderer.additions.js"
}
}
23 changes: 23 additions & 0 deletions webpack.renderer.additions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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']
}
};

0 comments on commit 6982fc5

Please sign in to comment.