forked from wexond/browser-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.main.js
More file actions
37 lines (34 loc) · 1006 Bytes
/
webpack.main.js
File metadata and controls
37 lines (34 loc) · 1006 Bytes
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
/* eslint-disable */
const { DefinePlugin } = require('webpack')
const { getOptimization, webpackModule, resolve, Mode, output, RENDERER_SERVER_PORT } = require('./webpack/utils')
module.exports = async (env) => {
const mode = (env && env.production) ? Mode.PRODUCTION : Mode.DEVELOPMENT
const optimization = getOptimization(mode)
return {
entry: { main: './src/launcher/index.ts' },
output,
devtool: false,
target: 'electron-main',
resolve,
mode,
optimization,
module: webpackModule,
node: {
__dirname: true,
},
plugins: [
new DefinePlugin({
__RENDERER_SERVER_PORT__: JSON.stringify(RENDERER_SERVER_PORT),
}),
],
externals: {
fs: 'commonjs fs',
path: 'commonjs path',
os: 'commonjs os',
process: 'commonjs process',
'node-window-manager': 'commonjs node-window-manager',
'node:http': 'commonjs http',
'node:https': 'commonjs https',
},
}
}