67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { resolve } from 'path';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tailwindcss(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,woff,png}'],
|
|
globIgnores: ['**/data/**'],
|
|
maximumFileSizeToCacheInBytes: 20 * 1024 * 1024,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /\/data\/.*\.json$/,
|
|
handler: 'StaleWhileRevalidate',
|
|
options: {
|
|
cacheName: 'ponomar-data',
|
|
expiration: { maxEntries: 200, maxAgeSeconds: 60 * 60 * 24 * 30 },
|
|
},
|
|
},
|
|
{
|
|
urlPattern: /\/data\/.*\.text$/,
|
|
handler: 'StaleWhileRevalidate',
|
|
options: {
|
|
cacheName: 'ponomar-bible',
|
|
expiration: { maxEntries: 100, maxAgeSeconds: 60 * 60 * 24 * 30 },
|
|
},
|
|
},
|
|
{
|
|
urlPattern: /\/fonts\/.*\.woff2?$/,
|
|
handler: 'CacheFirst',
|
|
options: {
|
|
cacheName: 'ponomar-fonts',
|
|
expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 365 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
manifest: {
|
|
name: 'Ponomar — Orthodox Calendar',
|
|
short_name: 'Ponomar',
|
|
description: 'Orthodox Church calendar and liturgical information',
|
|
start_url: '/',
|
|
display: 'standalone',
|
|
background_color: '#f5f0e8',
|
|
theme_color: '#1a1a2e',
|
|
orientation: 'portrait',
|
|
icons: [
|
|
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
port: 5173,
|
|
strictPort: false,
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
},
|
|
publicDir: 'static',
|
|
}); |