Fix dead manifest link and add proper PWA support

index.html linked /kds/manifest.json, which never existed (404).
Replaced with vite-plugin-pwa, matching the pattern used by every
other app, plus icons that were entirely missing before.
This commit is contained in:
jtricerolph 2026-07-29 17:28:50 +00:00
parent 8eb0ab457f
commit 46441c3b35
5 changed files with 27 additions and 3 deletions

View file

@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
<title>Kitchen Display</title>
<link rel="manifest" href="/kds/manifest.json" />
</head>
<body>
<div id="root"></div>

View file

@ -20,6 +20,7 @@
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"typescript": "^5.3.3",
"vite": "^5.0.11"
"vite": "^5.0.11",
"vite-plugin-pwa": "^1.3.0"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -1,7 +1,31 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [react()],
base: '/kds/',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Kitchen Display',
short_name: 'Kitchen Display',
start_url: '/kds/',
scope: '/kds/',
display: 'standalone',
theme_color: '#0d9488',
background_color: '#0d9488',
icons: [
{ src: '/kds/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/kds/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/kds/index.html',
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})