hydra/electron.vite.config.ts

66 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-04-21 08:26:29 +03:00
import { resolve } from "path";
import {
defineConfig,
loadEnv,
swcPlugin,
externalizeDepsPlugin,
2024-04-24 12:22:12 +03:00
bytecodePlugin,
2024-04-21 08:26:29 +03:00
} from "electron-vite";
import react from "@vitejs/plugin-react";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
2024-04-28 07:59:06 +03:00
import { sentryVitePlugin } from "@sentry/vite-plugin";
2024-04-21 08:26:29 +03:00
import svgr from "vite-plugin-svgr";
2024-04-25 07:52:19 +03:00
export default defineConfig(({ mode }) => {
2024-04-21 08:26:29 +03:00
loadEnv(mode);
2024-04-28 07:59:06 +03:00
const sentryPlugin = sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "hydra-launcher",
project: "hydra-launcher",
});
2024-04-21 08:26:29 +03:00
return {
main: {
build: {
2024-04-28 07:59:06 +03:00
sourcemap: true,
2024-04-21 08:26:29 +03:00
rollupOptions: {
external: ["better-sqlite3"],
},
},
resolve: {
alias: {
"@main": resolve("src/main"),
"@locales": resolve("src/locales"),
},
},
2024-04-28 07:59:06 +03:00
plugins: [
externalizeDepsPlugin(),
swcPlugin(),
bytecodePlugin(),
sentryPlugin,
],
2024-04-21 08:26:29 +03:00
},
preload: {
plugins: [externalizeDepsPlugin()],
},
renderer: {
2024-04-28 07:59:06 +03:00
build: {
sourcemap: true,
},
2024-04-21 08:26:29 +03:00
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
"@locales": resolve("src/locales"),
},
},
2024-04-28 07:59:06 +03:00
plugins: [
svgr(),
react(),
vanillaExtractPlugin(),
bytecodePlugin(),
sentryPlugin,
],
2024-04-21 08:26:29 +03:00
},
};
});