fix: nginx setup

This commit is contained in:
teier committed 2026-10-28 15:58:01 +01:00
1 parent 400e0408f3
commit 40b6afd85c
5 files changed
+31 -11

No files matched your search

+9 -5
View File
@@ -1,8 +1,12 @@
import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
// Relative Pfade, damit die App auch unter einem Unterpfad wie /ue1 läuft
base: "./",
plugins: [react()],
export default defineConfig(({ mode }) => {
// Pfad, unter dem die App ausgeliefert wird, z.B. BASE_PATH=/ue1 → https://sim.teier.net/ue1
// Absolut statt relativ, damit die Assets auch ohne abschließenden Schrägstrich gefunden werden
const pfad = (loadEnv(mode, ".", "").BASE_PATH ?? "").replace(/^\/+|\/+$/g, "");
return {
base: pfad ? `/${pfad}/` : "/",
plugins: [react()],
};
});