fix: nginx setup
This commit is contained in:
1 parent
400e0408f3
commit
40b6afd85c
5 files changed
+31
-11
No files matched your search
+9
-5
@@ -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()],
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user