Files
geo/apps/desktop-client/electron.vite.config.ts
T
root 73dfbbe8b5 perf(desktop): lazy-load renderer routes and pause polling when hidden
Drop the eager Antd global import in favour of unplugin-vue-components
on-demand resolution, async route components, defineAsyncComponent for
the shell/login split, and a dynamic Modal import inside
showClientActionError. Pair that with a visibility-aware runtime poller
that stops the 15s snapshot refresh when the window is hidden and kicks
off an immediate refresh on re-show. Refresh DesktopShell nav with
inline icons and a calmer active/hover treatment, and land
ActionButton/DisclosurePanel/PaginationBar primitives for upcoming
views.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 11:08:09 +08:00

76 lines
2.0 KiB
TypeScript

import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import vue from "@vitejs/plugin-vue";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
const rootDir = fileURLToPath(new URL(".", import.meta.url));
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
rollupOptions: {
input: {
bootstrap: resolve(rootDir, "src/main/bootstrap.ts"),
},
output: {
format: "cjs",
entryFileNames: "[name].cjs",
chunkFileNames: "[name]-[hash].cjs",
},
},
},
resolve: {
alias: {
"@main": resolve(rootDir, "src/main"),
},
},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
rollupOptions: {
input: {
bridge: resolve(rootDir, "src/preload/bridge.ts"),
},
output: {
format: "cjs",
entryFileNames: "[name].cjs",
chunkFileNames: "[name]-[hash].cjs",
},
},
},
resolve: {
alias: {
"@preload": resolve(rootDir, "src/preload"),
},
},
},
renderer: {
plugins: [
vue(),
Components({
dts: false,
resolvers: [
AntDesignVueResolver({
importStyle: false,
}),
],
}),
],
resolve: {
alias: {
"@renderer": resolve(rootDir, "src/renderer"),
"@geo/shared-types": resolve(rootDir, "../../packages/shared-types/src/index.ts"),
"@geo/http-client": resolve(rootDir, "../../packages/http-client/src/index.ts"),
"@geo/ui-shared": resolve(rootDir, "../../packages/ui-shared/src/index.ts"),
"@geo/ui-shared/tokens": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.ts"),
"@geo/ui-shared/tokens.css": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.css"),
},
},
},
});