feat(ui): add PWA support with vite-plugin-pwa

- Add vite.config.pwa.ts extending the base config with VitePWA plugin
- Generate PWA icons at build time from source logo via @vite-pwa/assets-generator
- Add web app manifest with name, theme color, display overrides
- Add Workbox runtime caching: NetworkFirst for API, CacheFirst for assets
- Set navigateFallback to null to preserve server-side auth redirects
- Server build uses build:pwa for PWA-enabled output; Electron/Tauri use
  the base build without PWA

Signed-off-by: Jesper Derehag <jderehag@hotmail.com>
This commit is contained in:
Jesper Derehag
2026-02-07 00:16:47 +01:00
parent 157fe9d6b4
commit 99474955af
5 changed files with 77 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build:pwa": "vite build -c vite.config.pwa.ts",
"preview": "vite preview",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
@@ -30,11 +31,13 @@
"solid-toast": "^0.5.0"
},
"devDependencies": {
"@vite-pwa/assets-generator": "^1.0.2",
"autoprefixer": "10.4.21",
"postcss": "8.5.6",
"tailwindcss": "3",
"typescript": "^5.3.0",
"vite": "^5.0.0",
"vite-plugin-pwa": "^1.2.0",
"vite-plugin-solid": "^2.10.0"
}
}