Files
h-school/src/HSchool.Client/vite.config.ts
T

31 lines
688 B
TypeScript

import { defineConfig } from 'vitest/config';
// Aspire injects SERVER_HTTP / SERVER_HTTPS from the `server` resource reference,
// so the dev server proxies to whatever port the backend actually got.
const backend = process.env.SERVER_HTTPS ?? process.env.SERVER_HTTP ?? 'http://localhost:5180';
export default defineConfig({
server: {
proxy: {
'/api': {
target: backend,
changeOrigin: true,
secure: false,
},
'/ws': {
target: backend,
changeOrigin: true,
secure: false,
ws: true,
},
},
},
build: {
target: 'es2022',
sourcemap: true,
},
test: {
environment: 'node',
},
});