feat: als pwa installierbar
- Manifest 'LAN-Clipboard' / 'Clipboard', standalone, eigene Icons (auch maskable) - iOS: apple-touch-icon, Web-App-Metadaten, Statusleiste black-translucent - Service Worker (vite-plugin-pwa) cacht nur die App-Hülle, nie /api - Hinweis 'Neue Version verfügbar' mit Neu laden - Offline-Seite, wenn beim Start kein Server erreichbar ist - Icons per scripts/render-icons.sh aus SVG gerendert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
998e86c84f
commit
0ad6d248cf
20 files changed
+5180
-6
No files matched your search
+39
-1
@@ -3,9 +3,47 @@ import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { defineConfig } from 'vite'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
plugins: [
|
||||
vue(),
|
||||
VitePWA({
|
||||
// Updates are applied after the user confirms (see src/pwa.ts)
|
||||
registerType: 'prompt',
|
||||
injectRegister: false,
|
||||
includeAssets: ['icons/icon.svg', 'icons/apple-touch-icon.png'],
|
||||
manifest: {
|
||||
name: 'LAN-Clipboard',
|
||||
short_name: 'Clipboard',
|
||||
description: 'Texte und Code-Snippets zwischen den eigenen Geräten teilen',
|
||||
lang: 'de',
|
||||
start_url: '/',
|
||||
scope: '/',
|
||||
display: 'standalone',
|
||||
background_color: '#0f1115',
|
||||
theme_color: '#0f1115',
|
||||
icons: [
|
||||
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
||||
{
|
||||
src: '/icons/icon-maskable-512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'maskable',
|
||||
},
|
||||
],
|
||||
},
|
||||
workbox: {
|
||||
// Only the app shell is cached; clip data from /api is never stored on the device
|
||||
globPatterns: ['**/*.{js,css,html,svg,png}'],
|
||||
navigateFallback: '/index.html',
|
||||
navigateFallbackDenylist: [/^\/api\//],
|
||||
runtimeCaching: [],
|
||||
cleanupOutdatedCaches: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user