-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
34 lines (32 loc) · 959 Bytes
/
webpack.common.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
const path = require('path')
const fs = require('fs')
let nodeModules = fs.readdirSync('./node_modules')
.filter((module) => {
return module !== '.bin';
})
.reduce((prev, module) => {
return Object.assign(prev, {[module]: 'commonjs ' + module});
}, {})
module.exports = {
entry: {
app: './gatekeeper-electron/application.js',
fork: './gatekeeper-electron/subprocess-wrapper.js'
},
output: {
path: path.resolve(__dirname, './webpack-build'),
filename: '[name].bundle.js'
},
module: {
rules: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/ },
]
},
target: 'electron',
node: {
/* http://webpack.github.io/docs/configuration.html#node */
__dirname: false,
__filename: false
},
externals: nodeModules
}