-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.main.js
45 lines (38 loc) · 993 Bytes
/
webpack.config.main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const merge = require('webpack-merge');
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const base = require('./webpack.config');
const config = {
/**
* Set target to Electron specific node.js env.
* https://github.com/chentsulin/webpack-target-electron-renderer#how-this-module-works
*/
target: 'electron-main',
entry: {
index: './src/main/index.js'
},
output: {
path: path.join(__dirname),
filename: 'index.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
node: {
/**
* Disables webpack processing of __dirname and __filename.
* If you run the bundle in node.js it falls back to these values of node.js.
* https://github.com/webpack/webpack/issues/2010
*/
__dirname: false,
__filename: false
},
externals: [nodeExternals()]
};
module.exports = merge.smart(base.config, config);