commit
79e08c74ed
@ -29,7 +29,7 @@
|
|||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
// Use the window load event to keep the page load performant
|
// Use the window load event to keep the page load performant
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
navigator.serviceWorker.register("/service-worker.js");
|
navigator.serviceWorker.register('service-worker.js', {scope: './'});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -68,6 +68,7 @@ module.exports = (options = {}) => merge(
|
|||||||
})
|
})
|
||||||
].concat(prod ? [
|
].concat(prod ? [
|
||||||
new GenerateSW({
|
new GenerateSW({
|
||||||
|
importWorkboxFrom: "local",
|
||||||
include: [cachePattern],
|
include: [cachePattern],
|
||||||
runtimeCaching: [{
|
runtimeCaching: [{
|
||||||
urlPattern: cachePattern,
|
urlPattern: cachePattern,
|
||||||
|
Reference in New Issue
Block a user