Update app.js

This commit is contained in:
Namhyeon Go 2023-12-11 12:10:54 +09:00 committed by GitHub
parent 7659507e9e
commit 0266da168f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

29
app.js
View File

@ -215,7 +215,34 @@ function require(FN) {
if (cache[FN]) return cache[FN];
// get file and directory name
var __filename__ = require.__getCurrentScriptDirectory__() + "\\" + FN;
var __filename__ = (function(getCurrentScriptDirectory, fileExists, path) {
var basepath = getCurrentScriptDirectory();
var filepaths = [
path.join(basepath, FN),
path.join(basepath, "bower_components", FN),
path.join(basepath, "node_modules", FN)
];
var filename = filepaths[0];
if (!fileExists(filename)) {
for (var i = 1; i < filepaths.length; i++) {
if (fileExists(filepaths[i])) {
filename = filepaths[i];
break;
}
}
}
return filename;
})(require.__getCurrentScriptDirectory__, CreateObject("Scripting.FileSystemObject").FileExists, {
join: function() {
var result = arguments[0];
for (var i = 1; i < arguments.length; i++) {
result += "\\" + arguments[i];
}
return result;
}
});
var __dirname__ = require.__getDirName__(__filename__);
var T = require.__load__(FN);