forked from CodySchrank/MTG-Arena-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.post.js
100 lines (99 loc) · 2.55 KB
/
webpack.post.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
module.exports = function post(common_config) {
return [
// MAIN
Object.assign({}, common_config, {
target: "electron-main",
entry: {
main: "./src/main/index.ts",
},
output: {
filename: "main.js",
path: path.join(__dirname, "lib"),
},
}),
// RENDERER
Object.assign({}, common_config, {
target: "electron-renderer",
entry: {
renderer: "./src/renderer/index.tsx",
},
output: {
filename: "index.js",
path: path.join(__dirname, "lib/renderer"),
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].[hash].css",
chunkFilename: "[id].[hash].css",
}),
new HtmlWebpackPlugin({
template: "src/assets/template.html",
}),
],
}),
// BACKGROUND
Object.assign({}, common_config, {
target: "electron-renderer",
entry: {
renderer: "./src/background/index.ts",
},
output: {
filename: "index.js",
path: path.join(__dirname, "lib/background"),
},
plugins: [
// Background should not require this
new MiniCssExtractPlugin({
filename: "[name].[hash].css",
chunkFilename: "[id].[hash].css",
}),
new HtmlWebpackPlugin({
template: "src/assets/template.html",
}),
],
}),
// OVERLAY
Object.assign({}, common_config, {
target: "electron-renderer",
entry: {
renderer: "./src/overlay/index.tsx",
},
output: {
filename: "index.js",
path: path.join(__dirname, "lib/overlay"),
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].[hash].css",
chunkFilename: "[id].[hash].css",
}),
new HtmlWebpackPlugin({
template: "src/assets/template.html",
}),
],
}),
// UPDATER
Object.assign({}, common_config, {
target: "electron-renderer",
entry: {
renderer: "./src/updater/index.tsx",
},
output: {
filename: "index.js",
path: path.join(__dirname, "lib/updater"),
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].[hash].css",
chunkFilename: "[id].[hash].css",
}),
new HtmlWebpackPlugin({
template: "src/assets/template.html",
}),
],
}),
];
};