Skip to content

Commit 25aeba7

Browse files
committed
fix: the manifest paths should not include the root
1 parent cc578db commit 25aeba7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/broccoli/service-worker-manifest.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ class DiffingSWManifest extends Plugin {
5757
var files = Object.keys(manifest).sort();
5858
var bundleHash = this.computeBundleHash(files, manifest);
5959
var contents = files
60-
.map((file) => `# sw.file.hash: ${this.computeFileHash(file)}\n${path.sep}${file}`)
60+
.map((file) => {
61+
return `# sw.file.hash: ${this.computeFileHash(file)}\n`
62+
+ `${path.sep}${path.relative(this.inputPaths[0], file)}`;
63+
})
6164
.join('\n');
62-
return `CACHE MANIFEST
63-
# sw.bundle: ng-cli
64-
# sw.version: ${bundleHash}
65-
${contents}
66-
`;
65+
return 'CACHE MANIFEST\n'
66+
+ '# sw.bundle: ng-cli\n'
67+
+ `# sw.version: ${bundleHash}\n`
68+
+ `${contents}\n`;
6769
}
6870

6971
// Read the manifest from the cache and split it out into a dict of files to hashes.

0 commit comments

Comments
 (0)