add service-worker-index.html

fixes #422
This commit is contained in:
Nolan Lawson
2018-12-01 15:48:39 -08:00
parent 02cef046aa
commit 03af9b1a16
5 changed files with 56 additions and 32 deletions

View File

@@ -45,17 +45,15 @@ export function create_serviceworker_manifest({ manifest_data, output, client_fi
client_files: string[];
static_files: string;
}) {
let files: string[];
let files: string[] = ['/service-worker-index.html'];
if (fs.existsSync(static_files)) {
files = walk(static_files);
files = files.concat(walk(static_files));
} else {
// TODO remove in a future version
if (fs.existsSync('assets')) {
throw new Error(`As of Sapper 0.21, the assets/ directory should become static/`);
}
files = [];
}
let code = `