-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to access service worker file as /sw.js #291
Comments
Hi @michaelu123 recently I tested the PWA approach as well. See here. For the generation of the service worker I used the plugin workbox-webpack-plugin. |
In the meantime I used the "serviceworker-webpack-plugin", Version 0.2.3 with Vue Version 2.6.14 and vue-template-compiler 2.6.14. All to be found in https://github.com/michaelu123/wegue. It may interest you, that our goal is to have a PWA that can work entirely offline, including the map tiles. This works only if we restrict the area and the zoomlevels. The map covers only a town quarter in Munich (Pasing), and zoom levels 14-16. The tiles consume ca. 8-10 Mbytes. We put them into a zip file, and let the service worker during installation decompose the zip and put the tiles into the static cache. To be seen in src/sw.js. |
Hi @michaelu123. Good to hear you got the service worker to work. |
I want to install wegue as a Progressive Web App, mainly, so that it runs also in offline mode. I can put all the tiles into the static folder. But I do not know how to put the service worker js file sw.js into the root directory, besides index.html. When I try to access the URL with /sw.js, I get a 404 error. I can put it into the static dir, so I can access /static/sw.js, but then /index.html is not in the scope of the service worker, and /index.html is not cached by the service worker, so the app can not run in offline mode.
What I need is a Vue route to /sw.js, but I do not know how this can be done with Wegue, as I can not see any routing code anywhere.
The text was updated successfully, but these errors were encountered: