mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
44 lines
981 B
TypeScript
44 lines
981 B
TypeScript
|
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";
|
||
|
|
||
|
export default defineConfig(({ command, mode }) => {
|
||
|
loadEnv(mode);
|
||
|
|
||
|
return {
|
||
|
main: {
|
||
|
build: {
|
||
|
rollupOptions: {
|
||
|
external: ["better-sqlite3"],
|
||
|
},
|
||
|
},
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
"@main": resolve("src/main"),
|
||
|
"@locales": resolve("src/locales"),
|
||
|
},
|
||
|
},
|
||
|
plugins: [externalizeDepsPlugin(), swcPlugin()],
|
||
|
},
|
||
|
preload: {
|
||
|
plugins: [externalizeDepsPlugin()],
|
||
|
},
|
||
|
renderer: {
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
"@renderer": resolve("src/renderer/src"),
|
||
|
"@locales": resolve("src/locales"),
|
||
|
},
|
||
|
},
|
||
|
plugins: [svgr(), react(), vanillaExtractPlugin()],
|
||
|
},
|
||
|
};
|
||
|
});
|