loader.js 286 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 exports.require = function loader(list) { const errorLog = []; for (const [name, fn] of list) { try { const data = fn(require(name)); data.name = name; return data; } catch (e) { errorLog.push(e); } } throw new Error(errorLog.join('\n')); };