symlink service worker for local dev, so its scope captures whole app

also rename service worker (as it is not a template anymore)
This commit is contained in:
Bruno Windels 2021-03-23 15:20:33 +01:00
parent a8ca82ca4d
commit 178790d816
3 changed files with 2 additions and 1 deletions

View File

@ -90,7 +90,7 @@ async function build({modernOnly}) {
await buildManifest(assets);
// all assets have been added, create a hash from all assets name to cache unhashed files like index.html
assets.addToHashForAll("index.html", devHtml);
let swSource = await fs.readFile(path.join(projectDir, "src/platform/web/service-worker.template.js"), "utf8");
let swSource = await fs.readFile(path.join(projectDir, "src/platform/web/service-worker.js"), "utf8");
assets.addToHashForAll("sw.js", swSource);
const globalHash = assets.hashForAll();

1
sw.js Symbolic link
View File

@ -0,0 +1 @@
src/platform/web/service-worker.js