(cfg)
| 121 | let config: ServiceWorkerConfig = null; |
| 122 | |
| 123 | function initConfig(cfg) { |
| 124 | config = cfg; |
| 125 | config.hosts ||= []; |
| 126 | config.domains = Array.from(new Set([location.host, ...(config.domains || [])])); |
| 127 | console.log('Config:', config); |
| 128 | } |
| 129 | |
| 130 | self.addEventListener('install', (event) => event.waitUntil((async () => { |
| 131 | if (process.env.NODE_ENV === 'production' && config?.preload) { |