Merge pull request #525 from nolanlawson/nolan/sw-index-html

add service-worker-index.html
This commit is contained in:
Rich Harris
2019-02-01 05:36:08 -05:00
committed by GitHub
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 = `