-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.main.config.js
More file actions
52 lines (51 loc) · 1.24 KB
/
Copy pathwebpack.main.config.js
File metadata and controls
52 lines (51 loc) · 1.24 KB
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
48
49
50
51
52
const path = require('path');
module.exports = {
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
devtool: process.env.NODE_ENV === 'development' ? 'eval-source-map' : false,
target: 'electron-main',
entry: {
main: './src/main/main.ts',
preload: './src/main/preload.ts',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'ts-loader',
options: {
configFile: 'tsconfig.main.json',
},
},
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'@': path.resolve(__dirname, 'src'),
'@main': path.resolve(__dirname, 'src/main'),
'@shared': path.resolve(__dirname, 'src/shared'),
},
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
},
node: {
__dirname: false,
__filename: false,
},
externals: {
// Ignore fsevents on non-macOS platforms
fsevents: "require('fsevents')",
},
stats: {
// Suppress the warning for fsevents
warningsFilter: [
/Module not found: Error: Can't resolve 'fsevents'/,
/Critical dependency: the request of a dependency is an expression/,
],
},
};