aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-26 15:31:10 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-26 15:31:10 -0700
commit5c847625b8bce597bbe05c0acf6ebd3e54eec3e7 (patch)
treedf776f03616948d0751b25a85e21ea5a8a7eb3a8
parent667d0f68daaa3916fac6653ef9994f6f2d05e177 (diff)
downloadtrackermap-web-5c847625b8bce597bbe05c0acf6ebd3e54eec3e7.tar.gz
trackermap-web-5c847625b8bce597bbe05c0acf6ebd3e54eec3e7.tar.bz2
trackermap-web-5c847625b8bce597bbe05c0acf6ebd3e54eec3e7.zip
Fix PWA issues
-rw-r--r--modern/public/manifest.json27
-rw-r--r--modern/vite.config.js34
2 files changed, 33 insertions, 28 deletions
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',
+ },
+ ],
+ },
+ }),
+ ],
}));