Fix PWA issues

This commit is contained in:
Anton Tananaev 2023-08-26 15:31:10 -07:00
parent 667d0f68da
commit 5c847625b8
2 changed files with 33 additions and 28 deletions

View File

@ -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"
}

View File

@ -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',
},
],
},
}),
],
}));