Files
home_hub/frontend/vite.config.ts
T
gilles 7b1b6521e5 feat(shopping): photo par article dans le catalogue
- Upload photo (context=product → thumbnail 150×150) dans CatalogueModal
- Miniature affichée dans la liste et dans le formulaire
- Schémas ProductCreate/Update/Response exposent image_path + thumbnail_path
- Backend sert /media/* via StaticFiles (FastAPI)
- Proxy /media → backend dans vite.config et nginx.conf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 06:37:33 +02:00

46 lines
1.3 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 },
'/media': { target: 'http://localhost:8000', changeOrigin: true },
},
},
})