mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
38 lines
890 B
TypeScript
38 lines
890 B
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`),
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'github-api-cache',
|
|
expiration: {
|
|
maxEntries: 2,
|
|
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
|
|
},
|
|
cacheableResponse: {
|
|
statuses: [0, 200],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
devOptions: {
|
|
enabled: true,
|
|
},
|
|
}),
|
|
],
|
|
});
|
|
|