refactor: use nuxt plugin to provide pwa helpers globally (#604)

This commit is contained in:
Daniel Roe 2022-12-28 15:08:03 +01:00 committed by GitHub
parent 73cec49cf0
commit 726a581add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 23 deletions

View file

@ -3,7 +3,7 @@ import type { VitePWANuxtOptions } from '../modules/pwa/types'
const isPreview = process.env.PULL_REQUEST === 'true'
const pwa: VitePWANuxtOptions = {
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'),
@ -49,5 +49,3 @@ const pwa: VitePWANuxtOptions = {
type: 'module',
},
}
export { pwa }