chore: disable pwa module when in preview mode (#483)

zio/stable
Daniel Roe 2022-12-21 00:06:51 +00:00 committed by GitHub
parent 2d49074242
commit 3391bce91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,8 +5,8 @@ const isPreview = process.env.PULL_REQUEST === 'true'
const pwa: VitePWANuxtOptions = {
mode: isCI ? 'production' : 'development',
// disable PWA only in development
disable: isDevelopment && process.env.VITE_DEV_PWA !== 'true',
// disable PWA only when in preview mode
disable: isPreview || (isDevelopment && process.env.VITE_DEV_PWA !== 'true'),
scope: '/',
srcDir: './service-worker',
filename: 'sw.ts',