Files
stacjownik/vite.config.ts
T
2022-07-16 16:12:31 +02:00

36 lines
881 B
TypeScript

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
runtimeCaching: [
{
urlPattern: new RegExp('^https://stacjownik.eu-4.evennode.com/api/getSceneries'),
handler: 'NetworkFirst',
options: {
cacheName: 'sceneries-cache',
expiration: {
maxEntries: 200,
maxAgeSeconds: 60 * 60 * 24 * 60, // <== 60 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
devOptions: {
enabled: true,
},
}),
],
});