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:
parent
8eb0ab457f
commit
46441c3b35
5 changed files with 27 additions and 3 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
|
||||||
<title>Kitchen Display</title>
|
<title>Kitchen Display</title>
|
||||||
<link rel="manifest" href="/kds/manifest.json" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
"@types/react-dom": "^18.2.18",
|
"@types/react-dom": "^18.2.18",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.0.11"
|
"vite": "^5.0.11",
|
||||||
|
"vite-plugin-pwa": "^1.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
frontend/public/icons/icon-192.png
Normal file
BIN
frontend/public/icons/icon-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
frontend/public/icons/icon-512.png
Normal file
BIN
frontend/public/icons/icon-512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
|
|
@ -1,7 +1,31 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
import { VitePWA } from 'vite-plugin-pwa'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
|
||||||
base: '/kds/',
|
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}'],
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue