Integrate vite-plugin-pwa to enable service worker generation, offline caching, and standalone display mode. Configure manifest metadata, 192px/512px icons, theme color, and iOS status bar styling. Bump project version to 0.3.59 across Cargo.toml, Cargo.lock, and version.txt, and regenerate package-lock.json.
80 lines
1.9 KiB
TypeScript
80 lines
1.9 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
base: '/app/',
|
|
manifest: {
|
|
name: 'PMOMusic',
|
|
short_name: 'PMOMusic',
|
|
description: 'Contrôleur UPnP/DLNA pour votre musique',
|
|
start_url: '/app/',
|
|
display: 'standalone',
|
|
orientation: 'any',
|
|
theme_color: '#111827',
|
|
background_color: '#111827',
|
|
icons: [
|
|
{
|
|
src: '/app/icons/icon-192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png',
|
|
},
|
|
{
|
|
src: '/app/icons/icon-512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'any maskable',
|
|
},
|
|
],
|
|
},
|
|
workbox: {
|
|
navigateFallback: '/app/index.html',
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^\/api\//,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
networkTimeoutSeconds: 5,
|
|
},
|
|
},
|
|
{
|
|
urlPattern: /^\/audio\//,
|
|
handler: 'NetworkOnly',
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
base: '/app/', // Base path pour le déploiement
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api/webrenderer/ws': {
|
|
target: 'ws://localhost:8080',
|
|
ws: true,
|
|
changeOrigin: true,
|
|
},
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
'/audio': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|