We plan to add offline capability to a web app that is based on the “Web SDK for plugins” concept, second generation. To serve static content like html, JS, CSS etc., we want to add a service worker that precaches static content when it receives the “install” window event.
However, We face some integration issues, which can be traced back to the build tool command “c8y build:app”:
- Usually, the JS code that registers the service is located in index.html, but this file is created by the build tool.
- The service worker registration passes a JS file that contains the service worker implementation. This file should be separate, it should not be compiled into a “main.js”.
Any idea how to resolve this?
Thanks in advance, Ulrich