From 7b47c9aab395cba8b8cc09655a28a81ce6ff064d Mon Sep 17 00:00:00 2001 From: Thomas Ghysels Date: Fri, 9 Mar 2018 15:51:39 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1042423..843458f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Sapper expects to find three directories in the root of your project — `assets The [assets](assets) directory contains any static assets that should be available. These are served using [serve-static](https://github.com/expressjs/serve-static). -In your [service-worker.js](templates/service-worker.js) file, Sapper makes these files available as `__assets__` so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). +In your [service-worker.js](app/service-worker.js) file, Sapper makes these files available as `__assets__` so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). ### routes @@ -43,11 +43,11 @@ There are three simple rules for naming the files that define your routes: This directory should contain the following files at a minimum: -* [2xx.html](templates/2xx.html) — a template for the page to serve for valid requests -* [4xx.html](templates/4xx.html) — a template for 4xx-range errors (such as 404 Not Found) -* [5xx.html](templates/5xx.html) — a template for 5xx-range errors (such as 500 Internal Server Error) -* [main.js](templates/main.js) — this module initialises Sapper -* [service-worker.js](templates/service-worker.js) — your app's service worker +* [app/client.js](app/client.js) — this module initialises Sapper +* [app/service-worker.js](app/service-worker.js) — your app's service worker +* [app/template.html](app/template.html) — a template for the page to serve for valid requests +* [routes/4xx.html](routes/4xx.html) — a template for 4xx-range errors (such as 404 Not Found) +* [routes/5xx.html](routes/5xx.html) — a template for 5xx-range errors (such as 500 Internal Server Error) Inside the HTML templates, Sapper will inject various values as indicated by `%sapper.xxxx%` tags. Inside JavaScript files, Sapper will replace strings like `__dev__` with the appropriate value. From 2b39a7617a805e43321f0b111d7091daff6870b4 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 11 Mar 2018 19:03:45 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 843458f..e78de7f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,13 @@ Sapper expects to find three directories in the root of your project — `assets The [assets](assets) directory contains any static assets that should be available. These are served using [serve-static](https://github.com/expressjs/serve-static). -In your [service-worker.js](app/service-worker.js) file, Sapper makes these files available as `__assets__` so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). +In your [service-worker.js](app/service-worker.js) file, you can import these as `assets` from the generated manifest... + +```js +import { assets } from './manifest/service-worker.js'; +``` + +...so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). ### routes