fix: login in works in subdomain
All checks were successful
Update changelog / changelog (push) Successful in 28s

This commit is contained in:
Pc
2026-01-04 13:33:15 +01:00
parent 4fa55b4caf
commit 549da339e4
2 changed files with 39 additions and 44 deletions

View File

@@ -1,29 +1,39 @@
import { defineConfig, loadEnv } from 'vite'
import { defineConfig, loadEnv, type PluginOption } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig(({ mode }) => {
// Ścieżka do folderu nadrzędnego
const envDirectory = path.resolve(__dirname, '..');
// Wczytujemy zmienne do użytku
const env = loadEnv(mode, envDirectory, '');
const backendTarget = env.VITE_API_TARGET;
return {
envDir: envDirectory,
envDir: envDirectory,
plugins: [
react(),
tailwindcss(),
react() as PluginOption,
tailwindcss() as PluginOption,
],
server: {
port: 6568,
host: true,
proxy: {
'/api': {
target: backendTarget,
changeOrigin: true,
secure: false,
},
},
},
preview: {
port: 6568,
allowedHosts: [env.VITE_ALLOWED_HOST],
port: 6568,
allowedHosts: true,
},
}
})