elk/config/pwa.ts

24 lines
796 B
TypeScript
Raw Normal View History

2022-12-18 03:15:19 +03:00
import { isCI, isDevelopment } from 'std-env'
import type { VitePWANuxtOptions } from '../modules/pwa/types'
export const pwa: VitePWANuxtOptions = {
mode: isCI ? 'production' : 'development',
// disable PWA only when in preview mode
disable: /* temporarily test in CI isPreview || */ (isDevelopment && process.env.VITE_DEV_PWA !== 'true'),
scope: '/',
srcDir: './service-worker',
2024-09-23 15:45:46 +03:00
filename: 'elk-sw.ts',
strategies: 'injectManifest',
injectRegister: false,
includeManifestIcons: false,
manifest: false,
injectManifest: {
globPatterns: ['**/*.{js,json,css,html,txt,svg,png,ico,webp,woff,woff2,ttf,eot,otf,wasm}'],
globIgnores: ['emojis/**', 'manifest**.webmanifest'],
},
devOptions: {
enabled: process.env.VITE_DEV_PWA === 'true',
type: 'module',
},
}