forked from SocialGouv/archifiltre-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.electron-main.js
42 lines (41 loc) · 944 Bytes
/
webpack.electron-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
const path = require("path");
const webpack = require("webpack");
require("dotenv").config();
module.exports = {
devServer: {
writeToDisk: true,
},
entry: {
main: "./src/electron-main.js",
},
module: {
rules: [
{
include: path.resolve(__dirname, "src"),
loader: "awesome-typescript-loader",
test: /\.[tj]sx?$/,
},
],
},
node: {
__dirname: false,
},
output: {
filename: "main.js",
path: path.resolve(__dirname, "electron/dist"),
pathinfo: false,
},
plugins: [
new webpack.DefinePlugin({
REACT_DEV_TOOLS_PATH: process.env.REACT_DEV_TOOLS_PATH
? JSON.stringify(process.env.REACT_DEV_TOOLS_PATH)
: '""',
SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN),
SENTRY_MINIDUMP_URL: JSON.stringify(process.env.SENTRY_MINIDUMP_URL),
}),
],
resolve: {
extensions: [".ts", ".js"],
},
target: "electron-main",
};