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', manifest: { name: 'Archivum', short_name: 'Archivum', description: 'AsciiDoc wiki with Git history', theme_color: '#0f172a', background_color: '#0f172a', display: 'standalone', // Icons are optional; add real PNG files to public/icons/ to enable PWA install. icons: [], }, workbox: { globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'], runtimeCaching: [ { urlPattern: /\/graphql$/, handler: 'NetworkFirst', options: { cacheName: 'api-cache' }, }, ], }, }), ], resolve: { alias: { '@': resolve(__dirname, 'src') }, }, server: { port: 5173, proxy: { '/graphql': { target: 'http://localhost:4000', changeOrigin: true }, }, }, })