From 5c847625b8bce597bbe05c0acf6ebd3e54eec3e7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Aug 2023 15:31:10 -0700 Subject: Fix PWA issues --- modern/public/manifest.json | 27 --------------------------- modern/vite.config.js | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 modern/public/manifest.json diff --git a/modern/public/manifest.json b/modern/public/manifest.json deleted file mode 100644 index 9142346c..00000000 --- a/modern/public/manifest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "short_name": "${title}", - "name": "${description}", - "icons": [ - { - "src": "favicon.ico", - "sizes": "48x48 32x32 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192", - "purpose": "any maskable" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512", - "purpose": "any maskable" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "${colorPrimary}", - "background_color": "#ffffff" -} diff --git a/modern/vite.config.js b/modern/vite.config.js index 04cff5fb..56ffa1ec 100644 --- a/modern/vite.config.js +++ b/modern/vite.config.js @@ -14,5 +14,37 @@ export default defineConfig(() => ({ build: { outDir: 'build', }, - plugins: [svgr(), react(), VitePWA()], + plugins: [ + svgr(), + react(), + VitePWA({ + workbox: { + navigateFallbackDenylist: [/^\/api/], + }, + manifest: { + short_name: '${title}', + name: '${description}', + theme_color: '${colorPrimary}', + icons: [ + { + src: 'favicon.ico', + sizes: '48x48 32x32 16x16', + type: 'image/x-icon', + }, + { + src: 'logo192.png', + type: 'image/png', + sizes: '192x192', + purpose: 'any maskable', + }, + { + src: 'logo512.png', + type: 'image/png', + sizes: '512x512', + purpose: 'any maskable', + }, + ], + }, + }), + ], })); -- cgit v1.2.3