fix: login in works in subdomain
All checks were successful
Update changelog / changelog (push) Successful in 28s
All checks were successful
Update changelog / changelog (push) Successful in 28s
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user