noticeboard/frontend/vite.config.ts
jtricerolph e720d02186 Make noticeboard installable as a PWA
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-11 11:27:00 +00:00

31 lines
890 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/notices/',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Noticeboard',
short_name: 'Notices',
start_url: '/notices/',
scope: '/notices/',
display: 'standalone',
theme_color: '#1e3a5f',
background_color: '#1e3a5f',
icons: [
{ src: '/notices/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/notices/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/notices/index.html',
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})