I hereby claim:
- I am matheusdonizete on github.
- I am matheusdonizete (https://keybase.io/matheusdonizete) on keybase.
- I have a public key ASAqetRz2N-lp8AyS_63wbtzYtKn2PxFHfbGwR94V_JjVAo
To claim this, I am signing this object:
module.exports = { | |
moduleFileExtensions: [ | |
'js', | |
'jsx', | |
'json', | |
'vue', | |
], | |
testEnvironment: 'jest-environment-jsdom-sixteen', | |
transform: { | |
'^.+\\.vue$': 'vue-jest', |
self.addEventListener('activate', function(event) { | |
const expectedCacheNames = Object.keys(currentCaches) | |
.map(key => currentCaches[key]); | |
event.waitUntil( | |
caches.keys().then(cacheNames => { | |
return Promise.all( | |
cacheNames.map(cacheName => { | |
if (expectedCacheNames.indexOf(cacheName) == -1) { | |
return caches.delete(cacheName); //exclusão de cache velho | |
} |
self.addEventListener('install', function(event) { | |
event.waitUntil( | |
caches.open(`v${cacheVersion}`) | |
.then(function(cache) { | |
return cache.addAll(cacheUrls); | |
}) | |
); | |
}); | |
self.addEventListener('fetch', function(event) { | |
event.respondWith( |
const cacheVersion = 1; | |
const currentCaches = { | |
font: `font-cache-v${cacheVersion}` | |
}; | |
//Starter example, caching some files | |
const cacheUrls = [ | |
'/', | |
'/js/app.js', | |
'/fonts/roboto/Roboto-Regular.woff2' | |
]; |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('./sw.js', { scope: './' }) | |
console.log('Service worker installing'); | |
} else if (reg.waiting) { | |
console.log('Service worker installed'); | |
console.log('Service worker active'); | |
}).catch((error) => console.log('Registration failed with ' + error)); |
I hereby claim:
To claim this, I am signing this object: