/
webpack.main.js
47 lines (45 loc) · 1.02 KB
/
webpack.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
46
47
const CopyPlugin = require('copy-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
let devtool = 'source-map';
if (process.env.NODE_ENV === 'production') {
devtool = undefined;
}
module.exports = {
mode: 'development',
devtool: devtool,
entry: {
main: ['./src/main/main.ts', './src/main/ipc.ts']
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'icons/*' },
]
}),
new ESLintPlugin({
extensions: ['.js', '.ts']
}),
],
module: {
rules: [
{
test: /\.node$/,
use: 'node-loader',
},
{
test: /\.ts$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: 'ts-loader',
}
},
],
},
resolve: {
extensions: ['.js', '.ts']
},
target: 'electron-main',
output: {
hashFunction: 'xxhash64',
}
};