feat: compatible symbolic links require

This commit is contained in:
2019-09-01 23:58:07 +08:00
parent 2d4bc3dd24
commit 160e7f4118
3 changed files with 22 additions and 6 deletions

View File

@ -60,6 +60,17 @@
return file.canonicalPath;
}
/**
* 获得文件绝对路径
* @param file
* @returns {*}
* @private
*/
function _absolute(file) {
// noinspection JSUnresolvedVariable
return file.absolutePath;
}
/**
* 获得缓存的文件名称
* @param file
@ -67,7 +78,7 @@
* @private
*/
function _cacheFile(file) {
return _canonical(file).replace(parent, cacheDir);
return _absolute(file).replace(parent, cacheDir);
}
/**
@ -108,12 +119,12 @@
return file;
}
// JS文件
var js = new File(normalizeName(_canonical(file), ".js"));
var js = new File(normalizeName(_absolute(file), ".js"));
if (js.isFile()) {
return js;
}
// JSON文件
var json = new File(normalizeName(_canonical(file), ".json"));
var json = new File(normalizeName(_absolute(file), ".json"));
if (json.isFile()) {
return json;
}