Skip to content

Commit 79e08c7

Browse files
authored
Merge pull request #834 from cdr/fix-sw-path
Fix service worker path
2 parents 3f2ad7b + 9b5a43e commit 79e08c7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/web/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
if ("serviceWorker" in navigator) {
3030
// Use the window load event to keep the page load performant
3131
window.addEventListener("load", () => {
32-
navigator.serviceWorker.register("/service-worker.js");
32+
navigator.serviceWorker.register('service-worker.js', {scope: './'});
3333
});
3434
}
3535
</script>

scripts/webpack.client.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ module.exports = (options = {}) => merge(
6868
})
6969
].concat(prod ? [
7070
new GenerateSW({
71+
importWorkboxFrom: "local",
7172
include: [cachePattern],
7273
runtimeCaching: [{
7374
urlPattern: cachePattern,

0 commit comments

Comments
 (0)