Files
Mdeical_Sur_Report/vite.config.ts
admin 7c6449b7bd Standardize SurClaw ports away from defaults
- Change the API default listen port from 3000 to 3100 and include the Docker frontend origin in default CORS.

- Point Vite's default API proxy, Docker API container port, and Nginx upstream to 3100.

- Keep Docker host ports on 4002 for web, 3002 for API, and 5433 for PostgreSQL.

- Update environment examples and documentation to remove stale localhost:3000 guidance.
2026-05-02 02:17:07 +08:00

38 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import {loadEnv} from 'vite';
import {defineConfig} from 'vitest/config';
export default defineConfig(({mode}) => {
const env = loadEnv(mode, '.', '');
const apiProxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:3100';
return {
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
server: {
// HMR is disabled in AI Studio via DISABLE_HMR env var.
// Do not modify—file watching is disabled to prevent flickering during agent edits.
hmr: process.env.DISABLE_HMR !== 'true',
proxy: {
'/api': {
target: apiProxyTarget,
changeOrigin: true,
ws: true,
},
},
},
test: {
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{ts,tsx}', 'server/**/*.{test,spec}.ts'],
exclude: ['e2e/**', 'node_modules/**', 'dist/**'],
globals: true,
setupFiles: './src/test/setup.ts',
},
};
});