Add PWA configuration and assets
- Install and configure @vite-pwa/nuxt module - Generate app icons in multiple sizes (192x192, 512x512, 180x180) - Create custom SVG icon with Nuxt + Authentik branding - Configure PWA manifest with theme colors and display options - Add Workbox service worker with caching strategies - Include NetworkFirst caching for Authentik API - Generate app store screenshots (mobile, tablet, desktop) - Enable offline functionality and auto-updates PWA Features: - Installable on mobile and desktop - Offline support with service worker - Custom splash screens and icons - Theme color: #00DC82 (Nuxt green) - App name: Plantilla Nuxt + Authentik
This commit is contained in:
@@ -8,7 +8,8 @@ export default defineNuxtConfig({
|
||||
'@nuxt/test-utils',
|
||||
'@nuxt/image',
|
||||
'@nuxt/eslint',
|
||||
'@nuxt/content'
|
||||
'@nuxt/content',
|
||||
'@vite-pwa/nuxt'
|
||||
],
|
||||
|
||||
css: ['~/assets/css/main.css'],
|
||||
@@ -17,5 +18,65 @@ export default defineNuxtConfig({
|
||||
public: {
|
||||
authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || 'https://authentik.nucleoriofrio.com'
|
||||
}
|
||||
},
|
||||
|
||||
pwa: {
|
||||
registerType: 'autoUpdate',
|
||||
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',
|
||||
orientation: 'portrait',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: '/icon-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
purpose: 'any'
|
||||
},
|
||||
{
|
||||
src: '/icon-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'any'
|
||||
},
|
||||
{
|
||||
src: '/icon-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'maskable'
|
||||
}
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
navigateFallback: '/',
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
|
||||
cleanupOutdatedCaches: true,
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /^https:\/\/authentik\.nucleoriofrio\.com\/.*/i,
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'authentik-api-cache',
|
||||
expiration: {
|
||||
maxEntries: 10,
|
||||
maxAgeSeconds: 60 * 60 * 24 // 24 hours
|
||||
},
|
||||
cacheableResponse: {
|
||||
statuses: [0, 200]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
type: 'module'
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user