1 import { register } from 'register-service-worker';
3 register('/service-worker.js', {
4 registrationOptions: { scope: './' },
6 console.log('Service worker is active.');
8 registered(registration) {
9 console.log('Service worker has been registered.');
11 cached(registration) {
12 console.log('Content has been cached for offline use.');
14 updatefound(registration) {
15 console.log('New content is downloading.');
17 updated(registration) {
18 console.log('New content is available; please refresh.');
22 'No internet connection found. App is running in offline mode.'
26 console.error('Error during service worker registration:', error);