mirror of
https://github.com/elk-zone/elk.git
synced 2024-12-05 03:59:59 +03:00
85ac005570
Co-authored-by: Daniel Roe <daniel@roe.dev>
23 lines
778 B
TypeScript
23 lines
778 B
TypeScript
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',
|
|
filename: '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,webmanifest}'],
|
|
globIgnores: ['emojis/**'],
|
|
},
|
|
devOptions: {
|
|
enabled: process.env.VITE_DEV_PWA === 'true',
|
|
type: 'module',
|
|
},
|
|
}
|