All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 2m6s
- Agregar id único (/?app=lotes), launch_handler, handle_links y url_handlers - Unificar workflow de 2 jobs (build + deploy) a 1 solo job - Workaround para bug de Gitea que solo ejecuta el primer job
167 lines
4.1 KiB
TypeScript
167 lines
4.1 KiB
TypeScript
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
devtools: { enabled: true },
|
|
|
|
modules: [
|
|
'@nuxt/ui',
|
|
'nuxt-auth-utils',
|
|
'@vite-pwa/nuxt'
|
|
],
|
|
|
|
// Runtime config para variables de entorno
|
|
runtimeConfig: {
|
|
// Variables privadas (solo servidor)
|
|
oauth: {
|
|
authentik: {
|
|
clientId: process.env.NUXT_OAUTH_AUTHENTIK_CLIENT_ID || '',
|
|
clientSecret: process.env.NUXT_OAUTH_AUTHENTIK_CLIENT_SECRET || '',
|
|
serverUrl: process.env.NUXT_OAUTH_AUTHENTIK_SERVER_URL || '',
|
|
serverUrlInternal: process.env.NUXT_OAUTH_AUTHENTIK_SERVER_URL_INTERNAL || '',
|
|
redirectURL: process.env.NUXT_OAUTH_AUTHENTIK_REDIRECT_URL || ''
|
|
}
|
|
},
|
|
// Variables públicas (cliente y servidor)
|
|
public: {
|
|
appUrl: process.env.NUXT_PUBLIC_APP_URL || ''
|
|
}
|
|
},
|
|
|
|
// Configuración PWA
|
|
pwa: {
|
|
registerType: 'autoUpdate',
|
|
manifest: {
|
|
id: '/?app=lotes',
|
|
name: 'Seguidor de Lotes',
|
|
short_name: 'Lotes',
|
|
description: 'Aplicación para seguimiento y gestión de lotes',
|
|
start_url: '/',
|
|
display: 'standalone',
|
|
background_color: '#1f2730',
|
|
theme_color: '#1f2730',
|
|
// Control de ventanas - mantener una sola ventana
|
|
launch_handler: {
|
|
client_mode: 'navigate-existing'
|
|
},
|
|
// Capturar enlaces dentro de la app
|
|
capture_links: 'existing-client-navigate',
|
|
// URL handling - nuevo estándar para manejar links a esta PWA
|
|
handle_links: 'preferred',
|
|
url_handlers: [
|
|
{ origin: 'https://seguidordelotes.nucleoriofrio.com' }
|
|
],
|
|
icons: [
|
|
{
|
|
src: 'icon-16x16.png',
|
|
sizes: '16x16',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-32x32.png',
|
|
sizes: '32x32',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-48x48.png',
|
|
sizes: '48x48',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-64x64.png',
|
|
sizes: '64x64',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-96x96.png',
|
|
sizes: '96x96',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-128x128.png',
|
|
sizes: '128x128',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-144x144.png',
|
|
sizes: '144x144',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-152x152.png',
|
|
sizes: '152x152',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-167x167.png',
|
|
sizes: '167x167',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-180x180.png',
|
|
sizes: '180x180',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-192x192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-256x256.png',
|
|
sizes: '256x256',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-384x384.png',
|
|
sizes: '384x384',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-1024x1024.png',
|
|
sizes: '1024x1024',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'icon-512x512-maskable.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'maskable'
|
|
},
|
|
{
|
|
src: 'icon-1024x1024-maskable.png',
|
|
sizes: '1024x1024',
|
|
type: 'image/png',
|
|
purpose: 'maskable'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
// Estrategia de caché para navegación offline
|
|
navigateFallback: '/',
|
|
navigateFallbackDenylist: [/^\/api\//],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^\/api\/.*/,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
expiration: {
|
|
maxEntries: 50,
|
|
maxAgeSeconds: 60 * 60 * 24 // 24 horas
|
|
},
|
|
networkTimeoutSeconds: 10
|
|
}
|
|
}
|
|
]
|
|
},
|
|
devOptions: {
|
|
enabled: true,
|
|
type: 'module'
|
|
}
|
|
}
|
|
}) |