- Authorization header ile Bearer token kimlik doğrulaması eklendi - Token'ların localStorage'da saklanması desteği eklendi - WEB_ALLOWED_ORIGINS ve WEB_ALLOWED_HOSTS konfigürasyonları eklendi - Loop işlerinde profileId ve profileName alanları eklendi - CORS ve Vite sunucusu için çoklu origin desteği sağlandı
25 lines
673 B
TypeScript
25 lines
673 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, path.resolve(__dirname, "../.."), "");
|
|
const allowedHosts = (env.WEB_ALLOWED_HOSTS || "")
|
|
.split(",")
|
|
.map((host) => host.trim().replace(/^"|"$/g, ""))
|
|
.filter(Boolean);
|
|
|
|
return {
|
|
plugins: [react()],
|
|
build: {
|
|
outDir: path.resolve(__dirname, "../server/public"),
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: Number(env.WEB_PORT) || 5173,
|
|
allowedHosts: allowedHosts.length ? allowedHosts : true,
|
|
},
|
|
};
|
|
});
|