forked from SocialGouv/archifiltre-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.electron-main.js
47 lines (46 loc) · 1.08 KB
/
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
43
44
45
46
47
const path = require("path");
const webpack = require("webpack");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
require("dotenv").config();
module.exports = {
devServer: {
writeToDisk: true,
},
entry: {
main: "./src/electron-main.js",
},
module: {
rules: [
{
include: path.resolve(__dirname, "src"),
loader: "ts-loader",
options: {
transpileOnly: true,
},
test: /\.[tj]sx?$/,
},
],
},
node: {
__dirname: false,
},
output: {
filename: "main.js",
path: path.resolve(__dirname, "electron/dist"),
pathinfo: false,
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
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",
};