fixes for windows file paths and drive letters

This commit is contained in:
Stewart Allen 2020-03-16 10:10:27 -04:00
commit 135cc359be

View file

@ -92,7 +92,10 @@ function lastmod(path) {
* @returns {*}
*/
function getCachedFile(filePath, cpath, fn) {
let cachePath = ".cache/" + cpath.replace(/\//g,'_'),
let cachePath = ".cache/" + cpath
.replace(/\//g,'_')
.replace(/\\/g,'_')
.replace(/:/g,'_'),
cached = fileCache[filePath],
now = time();
@ -182,9 +185,12 @@ function concatCode(array) {
filepath;
array.forEach((file, index) => {
if (file.charAt(0) === "/") {
if (file.charAt(0) === "/" || file.indexOf(":\\") > 0) {
filepath = file;
cachepath = "js_mod" + file.replace(/\//g,'_');
cachepath = "js_mod" + file
.replace(/\//g,'_')
.replace(/\\/g,'_')
.replace(/:/g,'_');
array[index] = cachepath.substring(3).replace('.js','');
fileMap[cachepath.replace("js_","js/")] = filepath;
} else {