Files
Archivum/frontend/vite.config.ts
Bjorn Blomberg 5819a6bdce
All checks were successful
build-and-push / build (push) Successful in 1m7s
feat(gitsync): webhook-triggad synk + helt manuellt läge
- POST /api/git-hook: HMAC-SHA256-verifierad (X-Gitea-Signature),
  reagerar bara på pushar till live-grenen, svarar 202 och synkar async
- webhook-hemlighet genereras server-side (headless via config.json),
  roteras med gitRegenerateWebhookSecret
- auto_sync_minutes=0 + webhook av ⇒ ingen automatisk hämtning alls;
  webhook på ⇒ catch-up-synk vid uppstart (missade event)
- admin-UI: webhook-toggle, target-URL + secret med copy/rotate

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-02 23:52:01 +02:00

59 lines
1.8 KiB
TypeScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import { resolve } from 'path'
export default defineConfig({
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
// Inject a cache-busting version based on build time so stale service
// workers are replaced immediately when a new image is deployed.
injectRegister: 'auto',
manifest: {
name: 'Archivum',
short_name: 'Archivum',
description: 'AsciiDoc wiki with Git history',
theme_color: '#0f172a',
background_color: '#0f172a',
display: 'standalone',
icons: [],
},
workbox: {
// Force the new service worker to activate immediately
// instead of waiting for all tabs to close.
skipWaiting: true,
clientsClaim: true,
maximumFileSizeToCacheInBytes: 5000000,
// Only cache these explicit file types — do NOT cache HTML so the
// SPA shell is always fetched fresh (prevents stale SW loops).
globPatterns: ['**/*.{js,css,woff2,png,svg,ico}'],
// Navigation requests (HTML) always go to the network.
navigateFallback: null,
runtimeCaching: [
{
urlPattern: /\/graphql$/,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
networkTimeoutSeconds: 5,
},
},
],
},
}),
],
resolve: {
alias: { '@': resolve(__dirname, 'src') },
},
server: {
port: 5173,
proxy: {
'/graphql': { target: 'http://localhost:4000', changeOrigin: true },
'/media': { target: 'http://localhost:4000', changeOrigin: true },
'/api': { target: 'http://localhost:4000', changeOrigin: true },
},
},
})