feat: PWA configurée — service worker, manifest, icônes

This commit is contained in:
2026-05-24 05:21:29 +02:00
parent 137213241b
commit e8aa9d6f3b
3 changed files with 34 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+34 -1
View File
@@ -1,8 +1,41 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [react()],
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2}'],
runtimeCaching: [
{
urlPattern: /^\/api\//,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: { maxEntries: 100, maxAgeSeconds: 86400 },
},
},
],
},
manifest: {
name: 'HomeHub',
short_name: 'HomeHub',
description: 'Organisation personnelle auto-hébergée',
theme_color: '#fe8019',
background_color: '#2a231d',
display: 'standalone',
orientation: 'portrait-primary',
start_url: '/',
icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' },
],
},
}),
],
server: {
proxy: {
'/api': { target: 'http://localhost:8000', changeOrigin: true },