45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^\/api\//,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
expiration: { maxEntries: 100, maxAgeSeconds: 86400 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
manifest: {
|
|
name: 'HomeHub',
|
|
short_name: 'HomeHub',
|
|
description: 'Organisation personnelle auto-hébergée',
|
|
theme_color: '#fe8019',
|
|
background_color: '#2a231d',
|
|
display: 'standalone',
|
|
orientation: 'portrait-primary',
|
|
start_url: '/',
|
|
icons: [
|
|
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' },
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
proxy: {
|
|
'/api': { target: 'http://localhost:8000', changeOrigin: true },
|
|
},
|
|
},
|
|
})
|