Configure electron-webpack
This commit is contained in:
parent
127b7733bc
commit
6982fc5647
2 changed files with 28 additions and 0 deletions
5
electron-webpack.json
Normal file
5
electron-webpack.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"renderer": {
|
||||
"webpackConfig": "webpack.renderer.additions.js"
|
||||
}
|
||||
}
|
23
webpack.renderer.additions.js
Normal file
23
webpack.renderer.additions.js
Normal file
|
@ -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']
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue