diff --git a/public/pwa-192x192.png b/public/pwa-192x192.png new file mode 100644 index 0000000..bb0efe4 Binary files /dev/null and b/public/pwa-192x192.png differ diff --git a/public/pwa-512x512.png b/public/pwa-512x512.png new file mode 100644 index 0000000..ad4c0de Binary files /dev/null and b/public/pwa-512x512.png differ diff --git a/public/site.webmanifest b/public/site.webmanifest deleted file mode 100644 index b20abb7..0000000 --- a/public/site.webmanifest +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "", - "short_name": "", - "icons": [ - { - "src": "/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -} diff --git a/vite.config.ts b/vite.config.ts index 486f045..d25aa54 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,14 +1,42 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; -import { VitePWA } from "vite-plugin-pwa"; +import { VitePWA, VitePWAOptions } from "vite-plugin-pwa"; + +const pwaOptions: Partial = { + registerType: "autoUpdate", + includeAssets: [ + "favicon.svg", + "favicon.ico", + "robots.txt", + "apple-touch-icon.png", + ], + manifest: { + name: "Walk-up alarm", + short_name: "Walk-up", + theme_color: "#ffffff", + icons: [ + { + src: "pwa-192x192.png", + sizes: "192x192", + type: "image/png", + }, + { + src: "pwa-512x512.png", + sizes: "512x512", + type: "image/png", + }, + { + src: "pwa-512x512.png", + sizes: "512x512", + type: "image/png", + purpose: "any maskable", + }, + ], + }, +}; // https://vitejs.dev/config/ export default defineConfig({ base: "/walk-up-alarm/", - plugins: [ - react(), - VitePWA({ - registerType: "autoUpdate", - }), - ], + plugins: [react(), VitePWA(pwaOptions)], });