Files
Havline/web/vite.config.ts
T
mrlee 278f8267b7 chore: 初始提交 Fonu 1.0.2
- 公网反代:Nginx 状态卡片(版本 / 运行状态 / 配置校验 / 端口监听)
- 部署设置第一、二梯队(HTTPS 开关、安全头、限流、连接数、仅中国大陆 IP)
- 隧道检测兼容 frps v0.68 / v0.71(V2 与旧版端点)
- 恢复被清空的 internal/frp/store.go、internal/api/ddns_handler.go、web/src/views/DdnsView.vue
2026-09-23 09:40:59 +08:00

34 lines
866 B
TypeScript

import { readFileSync } from 'node:fs'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8')) as { version: string }
export default defineConfig({
plugins: [vue()],
define: {
__APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || pkg.version),
},
server: {
port: 5173,
allowedHosts: true,
proxy: {
'/api': {
target: 'http://localhost:6893',
configure(proxy) {
proxy.on('proxyRes', (proxyRes, req) => {
if (req.url?.includes('/stream')) {
proxyRes.headers['cache-control'] = 'no-cache'
proxyRes.headers['x-accel-buffering'] = 'no'
}
})
},
},
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
},
})