/// 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(), 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', // Android / Chrome: appear in the system share sheet; see src/utils/share.ts share_target: { action: '/share', method: 'GET', params: { title: 'title', text: 'text', url: 'url' }, }, 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)) }, }, test: { environment: 'jsdom', include: ['src/**/*.test.ts'], }, server: { // Dev server forwards API calls to a locally running backend proxy: { '/api': 'http://localhost:8000' }, }, })