// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ ssr: true, devtools: { enabled: true }, css: ['~/assets/css/main.css'], modules: ['@nuxt/image', '@nuxt/ui', '@vite-pwa/nuxt'], // Performance optimizations experimental: { payloadExtraction: false }, // Vite config vite: { server: { hmr: { clientPort: 443, protocol: 'wss' }, allowedHosts: [ '.nucleoriofrio.com', 'whatsapp.nucleoriofrio.com' ] } }, app: { head: { title: 'WhatsApp Nucleo', 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: '#075e54' }, { 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: { experimental: { openAPI: true }, 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' } } } }, pwa: { registerType: 'autoUpdate', strategies: 'generateSW', manifestFilename: 'manifest.webmanifest', manifest: { id: '/?app=whatsapp', name: 'WhatsApp Nucleo', short_name: 'WhatsApp', description: 'Gestiona multiples instancias de WhatsApp desde un panel centralizado', start_url: '/', scope: '/', display: 'standalone', background_color: '#075e54', theme_color: '#075e54', icons: [ { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' } ] }, workbox: { globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'], navigateFallback: undefined, cleanupOutdatedCaches: true }, devOptions: { enabled: false } }, runtimeConfig: { // Server-side only databaseUrl: process.env.DATABASE_URL || 'postgresql://whatsapp:password@localhost:5432/whatsapp', masterApiKey: process.env.MASTER_API_KEY || '', // Public (client + server) public: { authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || 'https://authentik.nucleoriofrio.com' } } })