统一服务默认端口为 59188,完善 Windows 服务权限与 macOS LaunchAgent 管理。 实现 Windows 与 macOS 托盘状态机、服务启停等待、单实例保护、日志目录入口和退出前清理后台服务。 统一 Linux、Windows、macOS 与 Docker 的 Playwright Chromium runtime 构建流程,增加缓存、架构校验和 Linux 原生 runner,避免 QEMU。 完善 Windows、macOS、Linux 安装包及签名打包脚本,修正 Chromium 嵌入、服务注册和安装卸载流程。 同步 README、AGENTS、官网首页、Wiki 与前端开发文档,统一端口、初始化、服务、日志、托盘和安装说明。
164 lines
4.0 KiB
TypeScript
164 lines
4.0 KiB
TypeScript
import path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig({
|
|
base: '/static/',
|
|
server: {
|
|
port: 3000,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
// 代理API请求到后端
|
|
'/api': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
// 代理其他后端请求
|
|
'/cookies': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/account': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/qr-login': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/password-login': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/keywords': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/keywords-with-item-id': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/default-reply': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/items': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/cards': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/automation-rules': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/automation-issues': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/automation-runs': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/automation-pending-tasks': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/notification-channels': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/message-notifications': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/ai-reply-settings': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/ai-models': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/system-settings': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/user-settings': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/admin': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/analytics': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/login': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/verify': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/logout': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/change-password': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
'/health': {
|
|
target: 'http://localhost:59188',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, '.'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../internal/webui/static',
|
|
sourcemap: false,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
const modulePath = id.split(path.sep).join('/');
|
|
if (!modulePath.includes('/node_modules/')) {
|
|
return undefined;
|
|
}
|
|
if (
|
|
modulePath.includes('/react/') ||
|
|
modulePath.includes('/react-dom/') ||
|
|
modulePath.includes('/scheduler/')
|
|
) {
|
|
return 'react-vendor';
|
|
}
|
|
if (
|
|
modulePath.includes('/recharts/') ||
|
|
modulePath.includes('/victory-vendor/') ||
|
|
modulePath.includes('/d3-')
|
|
) {
|
|
return 'charts-vendor';
|
|
}
|
|
if (modulePath.includes('/lucide-react/')) {
|
|
return 'icons-vendor';
|
|
}
|
|
return 'vendor';
|
|
},
|
|
},
|
|
},
|
|
emptyOutDir: true,
|
|
},
|
|
});
|