Change service-worker.js path to serve PWA from subdirectory

I’m trying to deploy my PWA React app to a subdirectory on my web server, and have managed to get everything working except the service-worker.js. I can’t seem to find where the path to the service-worker.js file is defined?
I can see it’s trying to load from https://<server-host>/service-worker.js when it should be https://<server-host>/<subdir>/service-worker.js

I have tried adding "homepage": "." to my package.json, changing the 'start_url' to '/<subdir>' in manifest.json, but to no avail.

Ah! Think I’ve just found it in the app params in App.jsx.

1 Like

How? i’m having the same problem

In Framework7 App Parameters there’s an entry for serviceWorker, where you can pass in a string path to your service worker.