Fix building sw only in prod

This commit is contained in:
kolaente 2021-07-25 13:49:30 +02:00
parent 437ac3b0ef
commit 22a201568f
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import {register} from 'register-service-worker'
import swEvents from './ServiceWorker/events'
import {getToken} from './helpers/auth'
if (process.env.NODE_ENV === 'production') {
if (import.meta.env.PROD) {
register('/sw.js', {
ready() {
console.log('App is being served from cache by a service worker.')