From 621f87b2bde074d5317689f544f90714876dbbdc Mon Sep 17 00:00:00 2001 From: Vohmyanin Sergey Vasilevich Date: Tue, 10 Oct 2017 15:58:13 +0300 Subject: [PATCH] fix(service-worker): use posix path resolution for generation of ngsw.json (#19527) PR Close #19527 --- packages/service-worker/cli/filesystem.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/service-worker/cli/filesystem.ts b/packages/service-worker/cli/filesystem.ts index 51d910afe5..2852aa3130 100644 --- a/packages/service-worker/cli/filesystem.ts +++ b/packages/service-worker/cli/filesystem.ts @@ -21,12 +21,13 @@ export class NodeFilesystem implements Filesystem { const entries = fs.readdirSync(dir).map( (entry: string) => ({entry, stats: fs.statSync(path.join(dir, entry))})); const files = entries.filter((entry: any) => !entry.stats.isDirectory()) - .map((entry: any) => path.join(_path, entry.entry)); + .map((entry: any) => path.posix.join(_path, entry.entry)); return entries.filter((entry: any) => entry.stats.isDirectory()) - .map((entry: any) => path.join(_path, entry.entry)) + .map((entry: any) => path.posix.join(_path, entry.entry)) .reduce( - async(list: string[], subdir: string) => (await list).concat(await this.list(subdir)), + async(list: Promise, subdir: string) => + (await list).concat(await this.list(subdir)), Promise.resolve(files)); } @@ -46,5 +47,5 @@ export class NodeFilesystem implements Filesystem { fs.writeFileSync(file, contents); } - private canonical(_path: string): string { return path.join(this.base, _path); } -} \ No newline at end of file + private canonical(_path: string): string { return path.posix.join(this.base, _path); } +}