import { sentryVitePlugin } from "@sentry/vite-plugin";
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  main: {
    plugins: [
      externalizeDepsPlugin(),
      sentryVitePlugin({
        org: "imex",
        project: "imex-partner",
      }),
    ],
    build: {
      sourcemap: true,
    },
  },

  preload: {
    plugins: [externalizeDepsPlugin()],
  },

  renderer: {
    resolve: {
      alias: {
        "@renderer": resolve("src/renderer/src"),
      },
    },
    plugins: [
      react(),
      sentryVitePlugin({
        org: "imex",
        project: "imex-partner",
      }),
    ],
    build: {
      sourcemap: true,
    },
  },
});
