This enables offline navigation by caching HTML documents generated by SSR. When offline, users can now navigate to cached pages using the service worker.
102 lines
2.6 KiB
TypeScript
102 lines
2.6 KiB
TypeScript
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
devtools: { enabled: true },
|
|
|
|
modules: [
|
|
'@nuxt/ui',
|
|
'@nuxt/test-utils',
|
|
'@nuxt/image',
|
|
'@nuxt/eslint',
|
|
'@nuxt/content',
|
|
'@vite-pwa/nuxt'
|
|
],
|
|
|
|
css: ['~/assets/css/main.css'],
|
|
|
|
runtimeConfig: {
|
|
public: {
|
|
authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || 'https://authentik.nucleoriofrio.com'
|
|
}
|
|
},
|
|
|
|
pwa: {
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg'],
|
|
manifest: {
|
|
name: 'Plantilla Nuxt + Authentik',
|
|
short_name: 'NuxtAuth',
|
|
description: 'Plantilla de aplicación Nuxt 4 con autenticación mediante Authentik Proxy Outpost',
|
|
theme_color: '#00DC82',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
display_override: ['window-controls-overlay'],
|
|
orientation: 'portrait',
|
|
scope: '/',
|
|
start_url: '/',
|
|
icons: [
|
|
{
|
|
src: '/icon-192x192.png',
|
|
sizes: '500x192',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-512x512-maskable.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'maskable'
|
|
}
|
|
],
|
|
screenshots: [
|
|
{
|
|
src: '/screenshots/desktop-1.png',
|
|
sizes: '1920x1080',
|
|
type: 'image/png',
|
|
form_factor: 'wide',
|
|
label: 'Pantalla principal en escritorio'
|
|
},
|
|
{
|
|
src: '/screenshots/mobile-1.png',
|
|
sizes: '614x853',
|
|
type: 'image/png',
|
|
form_factor: 'narrow',
|
|
label: 'Pantalla principal en móvil'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
navigateFallback: '/',
|
|
globPatterns: ['**/*.{js,css,html,png,svg,ico,json}'],
|
|
cleanupOutdatedCaches: true,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/authentik\.nucleoriofrio\.com\/.*/i,
|
|
handler: 'NetworkOnly'
|
|
},
|
|
{
|
|
urlPattern: ({ request }) => request.mode === 'navigate',
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'pages-cache',
|
|
networkTimeoutSeconds: 3,
|
|
expiration: {
|
|
maxEntries: 10,
|
|
maxAgeSeconds: 60 * 60 * 24 // 24 hours
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
devOptions: {
|
|
enabled: true,
|
|
type: 'module'
|
|
}
|
|
}
|
|
}) |