hydra/electron.vite.config.ts

51 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2024-04-21 08:26:29 +03:00
import { resolve } from "path";
import {
defineConfig,
loadEnv,
swcPlugin,
externalizeDepsPlugin,
} from "electron-vite";
import react from "@vitejs/plugin-react";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr";
2024-06-03 04:12:05 +03:00
2024-04-25 07:52:19 +03:00
export default defineConfig(({ mode }) => {
2024-04-21 08:26:29 +03:00
loadEnv(mode);
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-29 13:01:34 +03:00
"@resources": resolve("resources"),
"@shared": resolve("src/shared"),
2024-04-21 08:26:29 +03:00
},
},
2024-11-02 20:06:30 +03:00
plugins: [externalizeDepsPlugin(), swcPlugin()],
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"),
"@shared": resolve("src/shared"),
2024-04-21 08:26:29 +03:00
},
},
2024-11-02 20:06:30 +03:00
plugins: [svgr(), react(), vanillaExtractPlugin()],
2024-04-21 08:26:29 +03:00
},
};
});