moved sw.js to static

This commit is contained in:
Miodec 2022-01-31 14:26:19 +01:00
parent 5facebe6bb
commit fc3efc20a4
3 changed files with 3 additions and 3 deletions

View file

@ -281,14 +281,14 @@ task("updateSwCacheName", function () {
date.getMinutes() +
"-" +
date.getSeconds();
return src(["static/sw.js"])
return src(["static/js/sw.js"])
.pipe(
replace(
/const staticCacheName = .*;/g,
`const staticCacheName = "sw-cache-${dateString}";`
)
)
.pipe(dest("./dist/"));
.pipe(dest("./dist/js/"));
});
task(

View file

@ -89,7 +89,7 @@
></script>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("sw.js");
navigator.serviceWorker.register("js/sw.js");
}
</script>
</head>