Files
UniVerse/frontend/vite.config.ts
T
serega404 779b6aba77
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 54s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 27s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
feat: первое подключение фронтенда
2026-05-11 01:33:38 +03:00

34 lines
984 B
TypeScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
// loadEnv(..., '') — чтобы получить и НЕ-VITE переменные при необходимости,
// но мы используем именно VITE_* для простоты прокидывания из AppHost.
const env = loadEnv(mode, process.cwd(), '')
const apiProxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:5019'
return {
plugins: [vue(), vueDevTools()],
server: {
host: true,
port: 5173,
proxy: {
'/api': {
target: apiProxyTarget,
changeOrigin: true,
secure: false,
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
}
})