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:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
export WORKBOX_DIR=public/3rdparty/workbox
|
||||
|
||||
rm -rf ${WORKBOX_DIR}
|
||||
workbox copyLibraries build/3rdparty/
|
||||
|
||||
mkdir -p public/3rdparty/workbox
|
||||
mv build/3rdparty/workbox-*/workbox-sw.js ${WORKBOX_DIR}
|
||||
mv build/3rdparty/workbox-*/workbox-core.prod.js ${WORKBOX_DIR}
|
||||
mv build/3rdparty/workbox-*/workbox-strategies.prod.js ${WORKBOX_DIR}
|
||||
mv build/3rdparty/workbox-*/workbox-routing.prod.js ${WORKBOX_DIR}
|
||||
mv build/3rdparty/workbox-*/workbox-navigation-preload.prod.js ${WORKBOX_DIR}
|
||||
rm -rf build/3rdparty/workbox-*
|
||||
Reference in New Issue
Block a user