diff --git a/frontend/index.html b/frontend/index.html index 6127376..472e9a9 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,6 @@ Kitchen Display -
diff --git a/frontend/package.json b/frontend/package.json index 997a2e2..950748d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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" } } diff --git a/frontend/public/icons/icon-192.png b/frontend/public/icons/icon-192.png new file mode 100644 index 0000000..07b2831 Binary files /dev/null and b/frontend/public/icons/icon-192.png differ diff --git a/frontend/public/icons/icon-512.png b/frontend/public/icons/icon-512.png new file mode 100644 index 0000000..fc0f5d4 Binary files /dev/null and b/frontend/public/icons/icon-512.png differ diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index f1224b7..1ef33fc 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -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}'], + }, + }), + ], })