Files
photo-live/apps/viewer/vite.config.ts
T

24 lines
794 B
TypeScript
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 vue from '@vitejs/plugin-vue';
import { defineConfig } from 'vitest/config';
// dev server 固定 5175(CORS_ORIGINS 已包含);/v1 代理仅作用于 `vite dev`,
// build/preview 不经此处——生产由网关同源挂载 /v1。
// host 显式 127.0.0.1:Windows 下 localhost 默认可能只绑 [::1],代理/e2e 探活走 IPv4。
export default defineConfig({
plugins: [vue()],
server: {
host: '127.0.0.1',
port: 5175,
strictPort: true,
proxy: {
'/v1': { target: 'http://127.0.0.1:8080', changeOrigin: true },
},
},
preview: { host: '127.0.0.1', port: 5175, strictPort: true },
test: {
environment: 'jsdom',
// 仅收集组件/单元测试;e2e/ 归 Playwright(test:e2e)
include: ['src/**/*.{test,spec}.ts'],
},
});