mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
On macOS and Windows, clicking the tray icon opens a panel with a Configuration tab (apps, in-use providers, modes, quota) and a Usage tab. Every row reuses the native menu's event id and goes through handle_tray_menu_event. Linux keeps the native menu and adds an "Open quick panel" item. macOS uses native glass under each card. Windows keeps a fixed canvas per popup and clips it with a window region, with opaque cards. Co-authored-by: funkpopo <funkpopoisme@gmail.com>
39 lines
886 B
TypeScript
39 lines
886 B
TypeScript
import path from "node:path";
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { codeInspectorPlugin } from "code-inspector-plugin";
|
|
|
|
export default defineConfig(({ command }) => ({
|
|
root: "src",
|
|
plugins: [
|
|
command === "serve" &&
|
|
codeInspectorPlugin({
|
|
bundler: "vite",
|
|
}),
|
|
react(),
|
|
].filter(Boolean),
|
|
base: "./",
|
|
build: {
|
|
outDir: "../dist",
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
// 托盘面板是单独的入口,不加载主界面
|
|
input: {
|
|
main: path.resolve(__dirname, "src/index.html"),
|
|
"tray-panel": path.resolve(__dirname, "src/tray-panel.html"),
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
strictPort: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
clearScreen: false,
|
|
envPrefix: ["VITE_", "TAURI_"],
|
|
}));
|