mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-10 05:16:19 +00:00
54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import { resolve } from "path";
|
|
import {
|
|
defineConfig,
|
|
loadEnv,
|
|
swcPlugin,
|
|
externalizeDepsPlugin,
|
|
} from "electron-vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import svgr from "vite-plugin-svgr";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
loadEnv(mode);
|
|
|
|
return {
|
|
main: {
|
|
build: {
|
|
sourcemap: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@main": resolve("src/main"),
|
|
"@locales": resolve("src/locales"),
|
|
"@resources": resolve("resources"),
|
|
"@shared": resolve("src/shared"),
|
|
},
|
|
},
|
|
plugins: [externalizeDepsPlugin(), swcPlugin()],
|
|
},
|
|
preload: {
|
|
plugins: [externalizeDepsPlugin()],
|
|
},
|
|
renderer: {
|
|
build: {
|
|
sourcemap: true,
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
api: "modern",
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@renderer": resolve("src/renderer/src"),
|
|
"@locales": resolve("src/locales"),
|
|
"@shared": resolve("src/shared"),
|
|
},
|
|
},
|
|
plugins: [svgr(), react()],
|
|
},
|
|
};
|
|
});
|