1 import { DefinePlugin, type Configuration } from "webpack";
2 import { rules } from "./webpack.rules";
3 import { readFileSync } from "node:fs";
4 import { z } from "zod";
5 import { resolve } from "node:path";
7 const AppConfigSchema = z.object({
9 sentryDesktop: z.string(),
13 const APP_CONFIG_PATH = resolve(__dirname, "../../packages/config/mail/appConfig.json");
14 const { appConfig } = AppConfigSchema.parse(JSON.parse(readFileSync(APP_CONFIG_PATH, "utf8")));
15 const sentryDSN = appConfig.sentryDesktop;
17 export const mainConfig: Configuration = {
19 * This is the main entry point for your application, it's the first file
20 * that runs in the main process.
22 entry: "./src/index.ts",
23 // Put your normal webpack config below here
29 type: "asset/resource",
35 "process.env.BUILD_TAG": JSON.stringify(process.env.BUILD_TAG),
36 "process.env.IDA_TAG": JSON.stringify(process.env.IDA_TAG),
37 "process.env.DESKTOP_SENTRY_DSN": JSON.stringify(sentryDSN),
41 extensions: [".js", ".ts", ".jsx", ".tsx", ".css", ".json"],