- aggiornamento con proj RISO. postcss, pwa.
This commit is contained in:
@@ -1,25 +1,23 @@
|
||||
/* eslint-disable no-undef */
|
||||
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching';
|
||||
import { precacheAndRoute } from 'workbox-precaching';
|
||||
import { registerRoute } from 'workbox-routing';
|
||||
import { clientsClaim, setCacheNameDetails, skipWaiting } from 'workbox-core';
|
||||
import { setCacheNameDetails } from 'workbox-core';
|
||||
import {
|
||||
NetworkFirst,
|
||||
NetworkOnly,
|
||||
StaleWhileRevalidate,
|
||||
CacheFirst,
|
||||
} from 'workbox-strategies';
|
||||
|
||||
const ENABLE_DYNAMIC_CACHING = false;
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
|
||||
import { ExpirationPlugin } from 'workbox-expiration';
|
||||
|
||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.5.4/workbox-sw.js');
|
||||
|
||||
self.addEventListener('install', () => self.skipWaiting());
|
||||
self.addEventListener('install', () => {
|
||||
console.log('Service Worker: Skip...');
|
||||
self.skipWaiting()
|
||||
});
|
||||
self.addEventListener('activate', (event) => {
|
||||
console.log('Service Worker: Activated');
|
||||
// console.log('CLAIM');
|
||||
//event.waitUntil(self.clients.claim())
|
||||
|
||||
@@ -39,7 +37,12 @@ const VITE_APP_VERSION = "1.1.23";
|
||||
|
||||
console.log(' [ VER-' + VITE_APP_VERSION + ' ] _---------________------ PAO: this is my custom service worker');
|
||||
|
||||
importScripts('js/idb.js', 'js/storage.js');
|
||||
try {
|
||||
importScripts('/js/idb.js', '/js/storage.js');
|
||||
console.log('Local scripts imported successfully.');
|
||||
} catch (error) {
|
||||
console.error('Failed to import local scripts:', error);
|
||||
}
|
||||
|
||||
let port = self.location.hostname.startsWith('test') ? 3001 : 3000;
|
||||
let ISTEST = self.location.hostname.startsWith('test');
|
||||
|
||||
Reference in New Issue
Block a user