|
@ -8,6 +8,7 @@ export default defineConfig(async () => { |
|
|
const appConfig = await loadAppConfig(); |
|
|
const appConfig = await loadAppConfig(); |
|
|
|
|
|
|
|
|
return mergeConfig(baseConfig, { |
|
|
return mergeConfig(baseConfig, { |
|
|
|
|
|
base: process.env.NODE_ENV === 'production' ? 'https://timesafari.anomalistdesign.com/' : './', |
|
|
plugins: [ |
|
|
plugins: [ |
|
|
VitePWA({ |
|
|
VitePWA({ |
|
|
registerType: 'autoUpdate', |
|
|
registerType: 'autoUpdate', |
|
@ -19,7 +20,22 @@ export default defineConfig(async () => { |
|
|
cleanupOutdatedCaches: true, |
|
|
cleanupOutdatedCaches: true, |
|
|
skipWaiting: true, |
|
|
skipWaiting: true, |
|
|
clientsClaim: true, |
|
|
clientsClaim: true, |
|
|
sourcemap: true |
|
|
sourcemap: true, |
|
|
|
|
|
navigateFallback: 'index.html', |
|
|
|
|
|
runtimeCaching: [{ |
|
|
|
|
|
urlPattern: /^https:\/\/timesafari\.anomalistdesign\.com\/.*/i, |
|
|
|
|
|
handler: 'CacheFirst', |
|
|
|
|
|
options: { |
|
|
|
|
|
cacheName: 'timesafari-cache', |
|
|
|
|
|
expiration: { |
|
|
|
|
|
maxEntries: 50, |
|
|
|
|
|
maxAgeSeconds: 60 * 60 * 24 * 30 // 30 days |
|
|
|
|
|
}, |
|
|
|
|
|
cacheableResponse: { |
|
|
|
|
|
statuses: [0, 200] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
] |
|
|
] |
|
|