add fallback module code injection, api.beta and api.new endpoint for apps
This commit is contained in:
parent
16a91b94c3
commit
418b5ba6a3
2 changed files with 16 additions and 2 deletions
11
app.js
11
app.js
|
|
@ -240,7 +240,16 @@ function initModule(mod, file, dir) {
|
|||
any: arg => { mod.add(arg) },
|
||||
code() {
|
||||
const [ path, file ] = [ ...arguments ];
|
||||
code[path] = fs.readFileSync(file);
|
||||
if (lastmod(file)) {
|
||||
code[path] = fs.readFileSync(file);
|
||||
// console.log({ CODE: path, file });
|
||||
} else if (lastmod(mod.dir + '/' + file)) {
|
||||
const alt = mod.dir + '/' + file;
|
||||
code[path] = fs.readFileSync(alt);
|
||||
// console.log({ CODE: path, alt });
|
||||
} else {
|
||||
console.log({ MISSING_CODE: path, file });
|
||||
}
|
||||
},
|
||||
full: arg => { mod.add(fullpath(arg)) },
|
||||
map: arg => { mod.add(fixedmap(arg)) },
|
||||
|
|
|
|||
Loading…
Reference in a new issue