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
+4 -2
View File
@@ -43,7 +43,8 @@
"@testing-library/user-event": "^13.2.1",
"css-mediaquery": "^0.1.2",
"prettier": "2.4.1",
"ra-test": "^3.18.2"
"ra-test": "^3.18.2",
"workbox-cli": "^6.3.0"
},
"scripts": {
"start": "react-scripts start",
@@ -51,7 +52,8 @@
"test": "react-scripts test",
"lint": "eslint --max-warnings 0 src/*.js src/**/*.js",
"prettier": "prettier --write src/*.js src/**/*.js",
"check-formatting": "prettier -c src/*.js src/**/*.js"
"check-formatting": "prettier -c src/*.js src/**/*.js",
"update-workbox": "bin/update-workbox.sh"
},
"homepage": ".",
"proxy": "http://localhost:4633/",