Fix service worker updates
This commit is contained in:
parent
4f9ec8b6a4
commit
270f38ab25
|
@ -34,7 +34,7 @@
|
||||||
"homepage": "https://stefano.brilli.me/webminidisc/",
|
"homepage": "https://stefano.brilli.me/webminidisc/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build && cat public/extra-service-worker.js build/service-worker.js > build/final-service-worker.js",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"predeploy": "npm run build",
|
"predeploy": "npm run build",
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// List of extra files to be precached for offline use.
|
||||||
|
// WARNING: don't forget to update the revision before deploy
|
||||||
|
var revision = "6";
|
||||||
|
self.__precacheManifest = (self.__precacheManifest || []).concat([
|
||||||
|
{
|
||||||
|
"revision": revision,
|
||||||
|
"url": "/webminidisc/atracdenc.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"revision": revision,
|
||||||
|
"url": "/webminidisc/worker.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"revision": revision,
|
||||||
|
"url": "/webminidisc/ffmpeg-core.js"
|
||||||
|
},
|
||||||
|
]);
|
|
@ -35,7 +35,7 @@ export function register(config?: Config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
const swUrl = `${process.env.PUBLIC_URL}/custom-service-worker.js`;
|
const swUrl = `${process.env.PUBLIC_URL}/final-service-worker.js`;
|
||||||
|
|
||||||
if (isLocalhost) {
|
if (isLocalhost) {
|
||||||
// This is running on localhost. Let's check if a service worker still exists or not.
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
|
Loading…
Reference in New Issue