Files
analiticaNucleo/nuxt4-app/nuxt.config.ts
josedario87 8e46838244
All checks were successful
deploy-analiticaNucleo / deploy (push) Successful in 36s
fix: agregar SUPABASE_SERVICE_ROLE_KEY al workflow y desactivar navigateFallback del SW
- Agregar SUPABASE_SERVICE_ROLE_KEY al workflow de Gitea Actions
- Usar variable correcta en docker-compose.yml
- Desactivar navigateFallback en workbox para evitar error de precached-url
- Actualizar documentación con los 3 secretos necesarios
2025-10-05 13:45:36 -06:00

161 lines
4.7 KiB
TypeScript

// https://nuxt.com/docs/api/configuration/nuxt-config
import { disableImportProtection } from './nuxt.config.workaround'
export default defineNuxtConfig({
ssr: false,
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
css: ['~/assets/css/main.css'],
modules: ['@nuxt/image', '@nuxt/ui', '@nuxt/test-utils', '@vite-pwa/nuxt', '@pinia/nuxt'],
// Performance optimizations
experimental: {
payloadExtraction: false,
viewTransition: true
},
// Optimize build
vite: {
plugins: [disableImportProtection()],
build: {
cssCodeSplit: true,
rollupOptions: {
output: {
manualChunks: {
'vendor-ui': ['@nuxt/ui'],
'vendor-pinia': ['pinia', '@pinia/nuxt']
}
}
}
}
},
app: {
head: {
link: [
{ rel: 'icon', type: 'image/png', href: '/icons/icon-192.png' },
{ rel: 'apple-touch-icon', sizes: '192x192', href: '/icons/icon-192.png' },
{ rel: 'manifest', href: '/manifest.webmanifest' }
],
meta: [
{ name: 'theme-color', content: '#1b1209' },
{ 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: {
'/**': {
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin'
}
},
'/manifest.webmanifest': {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Content-Type': 'application/manifest+json'
}
},
'/sw.js': {
headers: {
'Service-Worker-Allowed': '/',
'Cache-Control': 'public, max-age=0'
}
}
}
},
pwa: {
registerType: 'autoUpdate',
strategies: 'generateSW',
manifestFilename: 'manifest.webmanifest',
manifest: {
name: 'Analítica Núcleo Data Studio',
short_name: 'Analítica',
description: 'Explora y valida tus tablas Supabase desde un único panel en modo lectura.',
start_url: '/',
scope: '/',
display: 'standalone',
background_color: '#1b1209',
theme_color: '#c08040',
icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
{ src: '/icons/icon-192-maskable.png', sizes: '192x192', type: 'image/png', purpose: 'maskable' },
{ src: '/icons/icon-512-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
{ src: '/icons/icon-192-black.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512-black.png', sizes: '512x512', type: 'image/png' }
],
screenshots: [
{
src: '/screenshots/screenshot-desktop.png',
sizes: '2048x1041',
type: 'image/png',
form_factor: 'wide',
label: 'Dashboard en escritorio'
},
{
src: '/screenshots/screenshot-mobile.png',
sizes: '774x1459',
type: 'image/png',
form_factor: 'narrow',
label: 'Vista móvil'
}
]
},
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'],
navigateFallback: undefined, // Disable navigation fallback for SPA
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024,
runtimeCaching: [
{
urlPattern: /^https:\/\/szesytydotpnuiuwybwb\.supabase\.co\//,
handler: 'NetworkFirst',
method: 'GET',
options: {
cacheName: 'supabase-data',
networkTimeoutSeconds: 10,
expiration: {
maxEntries: 60,
maxAgeSeconds: 3600
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
client: {
installPrompt: true,
periodicSyncForUpdates: 3600
},
devOptions: {
enabled: process.env.NODE_ENV === 'development',
type: 'module'
},
includeAssets: [
'favicon.ico',
'icons/icon-192.png',
'icons/icon-512.png',
'icons/icon-192-maskable.png',
'icons/icon-512-maskable.png',
'icons/icon-192-black.png',
'icons/icon-512-black.png',
'screenshots/screenshot-desktop.png',
'screenshots/screenshot-mobile.png'
]
},
runtimeConfig: {
supabase: {
url: process.env.SUPABASE_URL || process.env.NEXT_PUBLIC_SUPABASE_URL,
serviceRoleKey:
process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY
}
}
})