PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
|
||||
import { register } from 'register-service-worker'
|
||||
|
||||
register(process.env.SERVICE_WORKER_FILE ? process.env.SERVICE_WORKER_FILE : '', {
|
||||
register(import.meta.env.VITE_SERVICE_WORKER_FILE ? import.meta.env.VITE_SERVICE_WORKER_FILE : '', {
|
||||
scope: '/',
|
||||
ready() {
|
||||
console.log('READY::: App is being served from cache by a service worker ' + process.env.SERVICE_WORKER_FILE)
|
||||
console.log('READY::: App is being served from cache by a service worker ' + import.meta.env.VITE_SERVICE_WORKER_FILE)
|
||||
},
|
||||
|
||||
registered(registration) { // registration -> a ServiceWorkerRegistration instance
|
||||
console.log('REGISTERED::: !!!', process.env.SERVICE_WORKER_FILE)
|
||||
console.log('REGISTERED::: !!!', import.meta.env.VITE_SERVICE_WORKER_FILE)
|
||||
},
|
||||
cached(registration) {
|
||||
console.log('CACHED::: Content has been cached for offline use.')
|
||||
@@ -35,4 +35,4 @@ register(process.env.SERVICE_WORKER_FILE ? process.env.SERVICE_WORKER_FILE : '',
|
||||
},
|
||||
});
|
||||
|
||||
// ServiceWorkerRegistration: https://developer.mozilla.org/enUs/docs/Web/API/ServiceWorkerRegistration
|
||||
// ServiceWorkerRegistration: https://developer.mozilla.org/enUs/docs/Web/API/ServiceWorkerRegistration
|
||||
|
||||
Reference in New Issue
Block a user