Use local copy of workbox service worker scripts (#1358)

* Use local copy of workbox service worker scripts

* Refactor workbox integration:

- Only add prod js, without maps. Reduces the size from 170k to 24k
- Removed it from build. As it is small now, we can add it to source, and have a script to just update it whenever it is required
- Fixed relative paths in navidrome-service-worker.js, should now work with BaseUrl != ''

Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Igor Rzegocki
2021-10-01 15:14:15 +02:00
committed by GitHub
parent b1e7760996
commit be3a6dc7a3
9 changed files with 2979 additions and 48 deletions
+6 -1
View File
@@ -1,5 +1,10 @@
// documentation: https://developers.google.com/web/tools/workbox/modules/workbox-sw
importScripts("https://storage.googleapis.com/workbox-cdn/releases/6.1.2/workbox-sw.js");
importScripts('3rdparty/workbox/workbox-sw.js')
workbox.setConfig({
modulePathPrefix: '3rdparty/workbox/',
debug: false,
})
workbox.loadModule('workbox-core');
workbox.loadModule('workbox-strategies');