mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-12 10:25:16 +00:00
generate rollup and webpack templates from a single unified branch
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<figcaption>HIGH FIVE!</figcaption>
|
||||
</figure>
|
||||
|
||||
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
|
||||
<p><strong>Try editing this file (routes/index.html) to test live reloading.</strong></p>
|
||||
|
||||
<style>
|
||||
h1, figure, p {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { timestamp, files, shell, routes } from '../__sapper__/service-worker.js
|
||||
|
||||
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 the bundler,
|
||||
// `files` is an array of everything in the `static` directory
|
||||
const to_cache = shell.concat(files);
|
||||
const cached = new Set(to_cache);
|
||||
@@ -42,7 +42,7 @@ self.addEventListener('fetch', event => {
|
||||
// ignore dev server requests
|
||||
if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
|
||||
|
||||
// always serve assets and webpack-generated files from cache
|
||||
// always serve static files and bundler-generated assets from cache
|
||||
if (url.host === self.location.host && cached.has(url.pathname)) {
|
||||
event.respondWith(caches.match(event.request));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user