Files
Hermes-ui/vite.config.ts
T
ekko 351c861777 refactor: restructure project for multi-agent extensibility
- Migrate source to packages/client and packages/server directories
- Namespace all Hermes-specific code under hermes/ subdirectories
  (api/hermes/, components/hermes/, views/hermes/, stores/hermes/)
- Add hermes.* route names and /hermes/* path prefixes
- Upgrade @koa/router to v15, adapt path-to-regexp v8 syntax
- Fix proxy path rewriting: /api/hermes/v1/* → /v1/*, /api/hermes/* → /api/*
- Fix frontend API paths to match backend /api/hermes/* routes
- Fix WebSocket terminal path to /api/hermes/terminal
- Add proxyMiddleware for reliable unmatched route proxying
- Add profiles route module and hermes-cli profile commands
- Update CLAUDE.md development guide with new architecture
- Add Chinese README (README_zh.md)
- Add Web Terminal feature to README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 08:38:18 +08:00

47 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import type { ProxyOptions } from 'vite'
import { resolve } from 'path'
const BACKEND = 'http://127.0.0.1:8648'
function createProxyConfig(): ProxyOptions {
return {
target: BACKEND,
changeOrigin: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.removeHeader('origin')
proxyReq.removeHeader('referer')
})
proxy.on('proxyRes', (proxyRes) => {
proxyRes.headers['cache-control'] = 'no-cache'
proxyRes.headers['x-accel-buffering'] = 'no'
})
},
}
}
export default defineConfig({
root: 'packages/client',
plugins: [vue()],
resolve: {
alias: {
'@': resolve(__dirname, 'packages/client/src'),
},
},
build: {
outDir: '../../dist/client',
emptyOutDir: true,
},
server: {
proxy: {
'/api': createProxyConfig(),
'/v1': createProxyConfig(),
'/health': createProxyConfig(),
'/upload': createProxyConfig(),
'/webhook': createProxyConfig(),
},
},
})