Files
genera-tor/vite.config.ts
T
2023-12-09 19:20:09 +01:00

39 lines
895 B
TypeScript

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
server: {
port: 8081,
},
plugins: [
vue(),
VitePWA({
registerType: 'prompt',
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/stacjownik.spythere.eu\/\/api\/getSceneries/i,
handler: 'CacheFirst',
options: {
cacheName: 'sceneries-cache',
expiration: {
maxEntries: 250,
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
devOptions: {
enabled: true,
},
}),
],
});