fix: Corregir configuración PWA y agregar logo en header
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
- Agregar app.head con meta tags para PWA (theme-color, apple-mobile-web-app-capable) - Configurar manifest.webmanifest con id, launch_handler, client.installPrompt - Agregar nitro.routeRules para headers correctos del manifest y sw.js - Agregar logo en TopBar del frontend - Crear apple-touch-icon.png - Eliminar carpeta pwa/ antigua (ahora se genera con @vite-pwa/nuxt)
This commit is contained in:
@@ -16,6 +16,39 @@ export default defineNuxtConfig({
|
||||
fallback: 'dark'
|
||||
},
|
||||
|
||||
app: {
|
||||
head: {
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/png', href: '/icons/icon-192.png' },
|
||||
{ rel: 'apple-touch-icon', sizes: '192x192', href: '/apple-touch-icon.png' },
|
||||
{ rel: 'manifest', href: '/manifest.webmanifest' }
|
||||
],
|
||||
meta: [
|
||||
{ name: 'theme-color', content: '#3f75d2' },
|
||||
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
nitro: {
|
||||
routeRules: {
|
||||
'/manifest.webmanifest': {
|
||||
headers: {
|
||||
'Content-Type': 'application/manifest+json',
|
||||
'Cache-Control': 'public, max-age=3600'
|
||||
}
|
||||
},
|
||||
'/sw.js': {
|
||||
headers: {
|
||||
'Service-Worker-Allowed': '/',
|
||||
'Cache-Control': 'public, max-age=0'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
runtimeConfig: {
|
||||
// Variables privadas del servidor (no expuestas al cliente)
|
||||
printerHost: process.env.PRINTER_HOST || '192.168.87.147',
|
||||
@@ -31,17 +64,28 @@ export default defineNuxtConfig({
|
||||
|
||||
pwa: {
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: ['favicon.ico', 'icon.png', 'icons/*.png'],
|
||||
strategies: 'generateSW',
|
||||
manifestFilename: 'manifest.webmanifest',
|
||||
includeAssets: [
|
||||
'favicon.ico',
|
||||
'icon.png',
|
||||
'apple-touch-icon.png',
|
||||
'icons/*.png'
|
||||
],
|
||||
manifest: {
|
||||
id: '/?app=printercentral',
|
||||
name: 'Printer Central',
|
||||
short_name: 'Printer',
|
||||
description: 'Administra tus impresoras de forma facil y rapida.',
|
||||
theme_color: '#3f75d2',
|
||||
background_color: '#ffffff',
|
||||
background_color: '#1a1a2e',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
launch_handler: {
|
||||
client_mode: 'navigate-existing'
|
||||
},
|
||||
icons: [
|
||||
{
|
||||
src: '/icons/icon-72.png',
|
||||
@@ -90,8 +134,9 @@ export default defineNuxtConfig({
|
||||
workbox: {
|
||||
navigateFallback: '/',
|
||||
navigateFallbackDenylist: [/^\/api\//],
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,ico,json,jpeg}'],
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,ico,json,jpeg,webp,woff2}'],
|
||||
cleanupOutdatedCaches: true,
|
||||
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024,
|
||||
runtimeCaching: [
|
||||
{
|
||||
// API calls siempre van a la red
|
||||
@@ -136,8 +181,12 @@ export default defineNuxtConfig({
|
||||
}
|
||||
]
|
||||
},
|
||||
client: {
|
||||
installPrompt: true,
|
||||
periodicSyncForUpdates: 3600
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
enabled: process.env.NODE_ENV === 'development',
|
||||
type: 'module'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user