From 8490154dde260a1c17419749ad904b9cfad12af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Wed, 11 Mar 2026 11:49:01 +0100 Subject: [PATCH] configure base path /tpf/ for subdirectory deployment, increase workbox cache limit Co-Authored-By: Claude Opus 4.6 --- public/manifest.webmanifest | 2 +- scripts/deploy.sh | 4 ++-- src/app.tsx | 10 +++++----- vite.config.ts | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index b0f5fdd..1a1f2d3 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -1,7 +1,7 @@ { "name": "TherapyFinder", "short_name": "TherapyFinder", - "start_url": "/", + "start_url": "/tpf/", "display": "standalone", "background_color": "#ffffff", "theme_color": "#09090b", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index b11572c..8fd66cc 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -3,9 +3,9 @@ set -euo pipefail # Description: Build and deploy TherapyFinder to Uberspace static hosting # Usage: ./scripts/deploy.sh -# Example: ./scripts/deploy.sh felixfoertsch@andromeda.uberspace.de +# Example: ./scripts/deploy.sh serve -HOST="${1:?Usage: ./scripts/deploy.sh }" +HOST="${1:-serve}" USER="$(ssh "$HOST" whoami)" REMOTE_DIR="/var/www/virtual/${USER}/html/tpf" diff --git a/src/app.tsx b/src/app.tsx index 279f6f0..81baa5a 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,14 +1,14 @@ -import { RouterProvider, createRouter } from "@tanstack/react-router" -import { routeTree } from "./routeTree.gen" +import { createRouter, RouterProvider } from "@tanstack/react-router"; +import { routeTree } from "./routeTree.gen"; -const router = createRouter({ routeTree }) +const router = createRouter({ routeTree, basepath: "/tpf" }); declare module "@tanstack/react-router" { interface Register { - router: typeof router + router: typeof router; } } export function App() { - return + return ; } diff --git a/vite.config.ts b/vite.config.ts index 24c043c..a1f2cd0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,7 @@ import { defineConfig } from "vite"; import { VitePWA } from "vite-plugin-pwa"; export default defineConfig({ + base: "/tpf/", plugins: [ tanstackRouter(), react(), @@ -15,6 +16,7 @@ export default defineConfig({ includeAssets: ["icons/icon-192.png", "icons/icon-512.png"], workbox: { globPatterns: ["**/*.{js,css,html,wasm,data}"], + maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, }, manifest: false, }),