Add Voice

This commit is contained in:
2026-04-05 10:22:09 +02:00
parent 55bd8a4e6b
commit 56086ec557
3 changed files with 147 additions and 66 deletions

View File

@@ -1,10 +1,32 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
host: true,
allowedHosts: ['prof.open-squared.tech']
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const allowedHost = env.VITE_ALLOWED_HOST || 'prof.open-squared.tech'
const proxyTarget = env.VITE_DEV_API_PROXY_TARGET || 'http://backend:8000'
const hmrHost = env.VITE_HMR_HOST
const hmrProtocol = env.VITE_HMR_PROTOCOL
const hmrClientPort = env.VITE_HMR_CLIENT_PORT ? Number(env.VITE_HMR_CLIENT_PORT) : undefined
return {
plugins: [react()],
server: {
host: true,
allowedHosts: [allowedHost],
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
},
hmr: hmrHost
? {
host: hmrHost,
protocol: hmrProtocol || 'ws',
clientPort: hmrClientPort,
}
: undefined,
},
}
})