feat: Unified PWA release
This commit is contained in:
commit
7116eb3466
13 changed files with 3537 additions and 0 deletions
22
sw.js
Normal file
22
sw.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
const CACHE_NAME = 'dienstplan-pro-v1';
|
||||
const ASSETS = [
|
||||
'./',
|
||||
'./index.html',
|
||||
'./styles.css',
|
||||
'./app.js',
|
||||
'./calculator.js',
|
||||
'./holidays.js',
|
||||
'./storage.js'
|
||||
];
|
||||
|
||||
self.addEventListener('install', (e) => {
|
||||
e.waitUntil(
|
||||
caches.open(CACHE_NAME).then((cache) => cache.addAll(ASSETS))
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (e) => {
|
||||
e.respondWith(
|
||||
caches.match(e.request).then((response) => response || fetch(e.request))
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue