forked from chrisknepper/android-messages-desktop
-
Notifications
You must be signed in to change notification settings - Fork 28
/
webpack.config.ts
49 lines (45 loc) · 1.01 KB
/
webpack.config.ts
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
import { Configuration } from "webpack";
import nodeExternals from "webpack-node-externals";
import process from "process";
import path from "path";
import merge from "webpack-merge";
const base: Configuration = {
mode: process.env.NODE_ENV === "development" ? "development" : "production",
externals: [nodeExternals()],
devtool: "source-map",
node: {
__dirname: false,
__filename: false,
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: ["ts-loader"],
},
],
},
resolve: {
extensions: [".ts", ".js"],
},
};
const main = merge(base, {
name: "background",
target: "electron-main",
entry: "./src/background.ts",
output: {
filename: "background.js",
path: path.resolve(__dirname, "app"),
},
});
const preload = merge(base, {
name: "bridge",
target: "electron-preload",
entry: "./src/bridge.ts",
output: {
filename: "bridge.js",
path: path.resolve(__dirname, "app"),
},
});
export default [main, preload];