Files
zPDF_package/vite.config.js
zikai 8482917e88 feat: vite proxy 简化为单条 /api
zTools2 所有入口已统一到 /api/ 下,dev proxy 从 /api/pdf + /api/admin/pdf
合并为单条 /api(target 127.0.0.1:6867),覆盖全部 PDF 相关接口。
2026-07-27 15:44:00 +08:00

24 lines
715 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 iframe
// preview 开放 f.zikai.wang 便于线上预览校验。
// dev 独立运行时zTools2 所有入口(页面/静态/探针/WS/API统一在 /api/ 下,
// 一条 /api 代理即可覆盖 /api/pdf/* 与 /api/admin/pdf/*,保持同源调用语义。
export default defineConfig({
plugins: [vue()],
base: './',
preview: {
allowedHosts: ['f.zikai.wang'],
},
server: {
port: 5175,
proxy: {
'/api': {
target: 'http://127.0.0.1:6867',
changeOrigin: true,
},
},
},
})