From 25aeba77bde07c1df40c273717d903e662566247 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 31 Mar 2016 11:25:46 -0700 Subject: [PATCH] fix: the manifest paths should not include the root --- lib/broccoli/service-worker-manifest.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/broccoli/service-worker-manifest.js b/lib/broccoli/service-worker-manifest.js index 7e8026011c25..2a111b7229c9 100644 --- a/lib/broccoli/service-worker-manifest.js +++ b/lib/broccoli/service-worker-manifest.js @@ -57,13 +57,15 @@ class DiffingSWManifest extends Plugin { var files = Object.keys(manifest).sort(); var bundleHash = this.computeBundleHash(files, manifest); var contents = files - .map((file) => `# sw.file.hash: ${this.computeFileHash(file)}\n${path.sep}${file}`) + .map((file) => { + return `# sw.file.hash: ${this.computeFileHash(file)}\n` + + `${path.sep}${path.relative(this.inputPaths[0], file)}`; + }) .join('\n'); - return `CACHE MANIFEST -# sw.bundle: ng-cli -# sw.version: ${bundleHash} -${contents} -`; + return 'CACHE MANIFEST\n' + + '# sw.bundle: ng-cli\n' + + `# sw.version: ${bundleHash}\n` + + `${contents}\n`; } // Read the manifest from the cache and split it out into a dict of files to hashes.