fix(service-worker): use posix path resolution for generation of ngsw.json (#19527)
PR Close #19527
This commit is contained in:
parent
64b36190de
commit
621f87b2bd
|
@ -21,12 +21,13 @@ export class NodeFilesystem implements Filesystem {
|
||||||
const entries = fs.readdirSync(dir).map(
|
const entries = fs.readdirSync(dir).map(
|
||||||
(entry: string) => ({entry, stats: fs.statSync(path.join(dir, entry))}));
|
(entry: string) => ({entry, stats: fs.statSync(path.join(dir, entry))}));
|
||||||
const files = entries.filter((entry: any) => !entry.stats.isDirectory())
|
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())
|
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(
|
.reduce(
|
||||||
async(list: string[], subdir: string) => (await list).concat(await this.list(subdir)),
|
async(list: Promise<string[]>, subdir: string) =>
|
||||||
|
(await list).concat(await this.list(subdir)),
|
||||||
Promise.resolve(files));
|
Promise.resolve(files));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,5 +47,5 @@ export class NodeFilesystem implements Filesystem {
|
||||||
fs.writeFileSync(file, contents);
|
fs.writeFileSync(file, contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
private canonical(_path: string): string { return path.join(this.base, _path); }
|
private canonical(_path: string): string { return path.posix.join(this.base, _path); }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue