21 lines
600 B
TypeScript
21 lines
600 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// Бэкенд для dev-прокси (Api слушает http://localhost:8080). См. docs/frontend.md.
|
|
const apiTarget = process.env.VITE_API_TARGET ?? 'http://localhost:8080'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
proxy: {
|
|
'/api': { target: apiTarget, changeOrigin: true },
|
|
'/hubs': { target: apiTarget, changeOrigin: true, ws: true },
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
})
|