From be901b94325d8a9151a58a85e04312368b640d59 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 2 Jan 2018 10:18:28 -0500 Subject: [PATCH] minor updates --- templates/main.js | 2 +- templates/service-worker.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/main.js b/templates/main.js index de8815b..aa08cb0 100644 --- a/templates/main.js +++ b/templates/main.js @@ -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 init(document.querySelector('#sapper'), __routes__); \ No newline at end of file diff --git a/templates/service-worker.js b/templates/service-worker.js index dc9fee1..cccb12a 100644 --- a/templates/service-worker.js +++ b/templates/service-worker.js @@ -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, // `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.) event.respondWith( caches - .open('offline') + .open(`offline${timestamp}`) .then(async cache => { try { const response = await fetch(event.request);