This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { crawl } from "../../tools/crawl";
|
import { crawl } from "../../tools/crawl";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin, sep as pathSep } from "path";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import type { ThemeType } from "../generateFtl";
|
import type { ThemeType } from "../generateFtl";
|
||||||
|
|
||||||
@ -74,10 +74,14 @@ export function readPaths(params: { rawSourceFile: string }): {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const removePrefixSlash = (filePath: string) => (filePath.startsWith("/") ? filePath.slice(1) : filePath);
|
const normalizePath = (filePath: string) => {
|
||||||
|
filePath = filePath.startsWith("/") ? filePath.slice(1) : filePath;
|
||||||
|
filePath = filePath.replace(/\//g, pathSep);
|
||||||
|
return filePath;
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"resourcesCommonFilePaths": Array.from(resourcesCommonFilePaths).map(removePrefixSlash),
|
"resourcesCommonFilePaths": Array.from(resourcesCommonFilePaths).map(normalizePath),
|
||||||
"resourcesFilePaths": Array.from(resourcesFilePaths).map(removePrefixSlash)
|
"resourcesFilePaths": Array.from(resourcesFilePaths).map(normalizePath)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user