Browse Source

PWA config

master
Alexander Jäger 1 year ago
parent
commit
9070c93815
2 changed files with 29 additions and 0 deletions
  1. +21
    -0
      src/service-worker.js
  2. +8
    -0
      vue.config.js

+ 21
- 0
src/service-worker.js View File

@ -0,0 +1,21 @@
/**
* This was copied from the default workrer and should be adapted. The injected stuff will be above
*/
workbox.core.setCacheNameDetails({prefix: "hackerspace"});
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});

+ 8
- 0
vue.config.js View File

@ -0,0 +1,8 @@
module.exports = {
pwa: {
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: 'src/service-worker.js'
}
}
}

Loading…
Cancel
Save