mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-19 21:15:21 +00:00
minor updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { init } from 'sapper/runtime/app.js';
|
import { init } from 'sapper/runtime.js';
|
||||||
|
|
||||||
// `routes` is an array of route objects injected by Sapper
|
// `routes` is an array of route objects injected by Sapper
|
||||||
init(document.querySelector('#sapper'), __routes__);
|
init(document.querySelector('#sapper'), __routes__);
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const ASSETS = `cache__timestamp__`;
|
const timestamp = '__timestamp__';
|
||||||
|
const ASSETS = `cache${timestamp}`;
|
||||||
|
|
||||||
// `shell` is an array of all the files generated by webpack,
|
// `shell` is an array of all the files generated by webpack,
|
||||||
// `assets` is an array of everything in the `assets` directory
|
// `assets` is an array of everything in the `assets` directory
|
||||||
@@ -60,7 +61,7 @@ self.addEventListener('fetch', event => {
|
|||||||
// might prefer a cache-first approach to a network-first one.)
|
// might prefer a cache-first approach to a network-first one.)
|
||||||
event.respondWith(
|
event.respondWith(
|
||||||
caches
|
caches
|
||||||
.open('offline')
|
.open(`offline${timestamp}`)
|
||||||
.then(async cache => {
|
.then(async cache => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(event.request);
|
const response = await fetch(event.request);
|
||||||
|
|||||||
Reference in New Issue
Block a user