forked from nicholas-ochoa/OpenSC2K
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.main.js
More file actions
66 lines (65 loc) · 1.65 KB
/
webpack.main.js
File metadata and controls
66 lines (65 loc) · 1.65 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const NodemonPlugin = require('nodemon-webpack-plugin');
const WebpackBar = require('webpackbar');
/* eslint-enable */
module.exports = env => {
return {
target: 'electron-main',
mode: env.production ? 'production' : 'development',
watch: env.development,
entry: {
main: path.resolve(__dirname, 'src/main/index.ts'),
},
output: {
pathinfo: true,
filename: 'main.js',
path: path.resolve(__dirname, 'dist', 'main'),
},
optimization: {
nodeEnv: false,
},
devtool: 'source-map',
stats: 'errors-only',
performance: { hints: false },
plugins: [
new CleanWebpackPlugin(),
new WebpackBar(),
new webpack.WatchIgnorePlugin([/dist/, /node_modules/]),
new NodemonPlugin({
nodeArgs: ['--inspect'],
watch: ['./dist/main/'],
verbose: false,
exec: 'cross-env NODE_ENV=development run-electron . --inspect',
ext: 'js,yaml',
delay: 3,
}),
],
resolve: {
plugins: [
new TsconfigPathsPlugin({
logInfoToStdOut: true,
extensions: ['.ts', '.js'],
baseUrl: 'src/main',
}),
],
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
compilerOptions: {
baseUrl: 'src/main',
},
},
},
],
},
};
};