04b5641901
Co-Authored-By: Claude Code <noreply@anthropic.com>
24 lines
794 B
TypeScript
24 lines
794 B
TypeScript
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'],
|
||
},
|
||
});
|