feat(m5): PWA service worker, offline Dexie store, outbox, sync endpoints

This commit is contained in:
2026-04-30 16:47:27 +02:00
parent df04d9d7a9
commit 4a328ad6cc
12 changed files with 4995 additions and 6 deletions

View File

@@ -1,8 +1,45 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [sveltekit()],
plugins: [
sveltekit(),
VitePWA({
registerType: 'autoUpdate',
strategies: 'generateSW',
injectRegister: 'auto',
workbox: {
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff,woff2}'],
navigateFallback: 'index.html',
navigateFallbackDenylist: [/^\/api/, /^\/healthz/],
runtimeCaching: [
{
urlPattern: /^\/api\//,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
networkTimeoutSeconds: 5,
cacheableResponse: { statuses: [0, 200] }
}
}
]
},
manifest: {
name: 'Wotra — Working Time Tracker',
short_name: 'Wotra',
description: 'Track your working hours, close days and weeks, compute overtime.',
theme_color: '#1a1a2e',
background_color: '#f8f9fa',
display: 'standalone',
start_url: '/',
icons: [
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png' }
]
}
})
],
server: {
proxy: {
'/api': 'http://localhost:8080',