mirror of
https://github.com/elk-zone/elk.git
synced 2024-12-21 03:43:11 +03:00
320ddc0e28
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
23 lines
796 B
TypeScript
23 lines
796 B
TypeScript
import type { VitePWANuxtOptions } from '../modules/pwa/types'
|
|
import { isCI, isDevelopment } from 'std-env'
|
|
|
|
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: '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',
|
|
},
|
|
}
|