55 lines
1.5 KiB
JavaScript
Executable File
55 lines
1.5 KiB
JavaScript
Executable File
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['icon.svg', 'icon-192.png', 'icon-512.png'],
|
|
manifest: {
|
|
id: '/',
|
|
name: 'Enkelbudget',
|
|
short_name: 'Budget',
|
|
description: 'Enkel månadsbudget och lånehanterare',
|
|
start_url: '/',
|
|
scope: '/',
|
|
display: 'standalone',
|
|
display_override: ['window-controls-overlay', 'standalone', 'minimal-ui'],
|
|
orientation: 'portrait',
|
|
background_color: '#F8FAFC',
|
|
theme_color: '#2563EB',
|
|
lang: 'sv',
|
|
icons: [
|
|
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any maskable' },
|
|
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' },
|
|
],
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
|
navigateFallbackDenylist: [
|
|
/^\/api\//,
|
|
/^\/auth\//,
|
|
/^\/enablebanking\//,
|
|
],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^\/api\//,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
expiration: { maxEntries: 50, maxAgeSeconds: 86400 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
proxy: {
|
|
'/api': 'http://localhost:7843',
|
|
},
|
|
},
|
|
});
|