Files
zWhiteBoard/vite.config.js
zikai d7d7450296 feat: 共享记事本前端 zWhiteBoard
textarea + WebSocket 实时同步、心跳、断线重连的便携式 Vue 组件。
复用 zTools2 的 /api/wb/* 与 /api/ws/wb/* 接口,与 zPDF_package 集成范式一致。
可独立运行或经 mainPage 构建期组件 import 集成(:locale + :boardId props)。
2026-07-28 10:32:41 +08:00

26 lines
832 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// 便携式构建base './' 使产物可被任意路径托管(含 zTools2 /api/static 与 mainPage 组件 import
// preview 开放 f.zikai.wang 便于线上预览校验。
// dev 独立运行时zTools2 所有入口(页面/静态/探针/WS/API统一在 /api/ 下,
// 一条 /api 代理即可覆盖 /api/wb/* 与 /api/ws/wb/*。
// ★ ws:true 让 /api/ws/wb/{id} 的 WebSocket 也走此代理(白板依赖 WS与 zPDF_package 仅 REST 不同)。
export default defineConfig({
plugins: [vue()],
base: './',
preview: {
allowedHosts: ['f.zikai.wang'],
},
server: {
port: 5176,
proxy: {
'/api': {
target: 'http://127.0.0.1:6867',
changeOrigin: true,
ws: true,
},
},
},
})