diff --git a/config/bulk-load.js b/config/bulk-load.js index af270df..eb309dd 100644 --- a/config/bulk-load.js +++ b/config/bulk-load.js @@ -1,5 +1,13 @@ var rg = require("require-glob"); +const path = require('path'); + module.exports = function (folder) { - var items = rg.sync(__dirname + "/" + folder + "/*.js", {keygen: function (options, file) { return file.path.match(/\/([^\/.]+)\./)[1]; }}); + + var items = rg.sync(__dirname + "/" + folder + "/*.js", {keygen: function (options, file) + { + //console.log("Loading item: " + file.path.replace(file.base + path.sep, '').replace(/.\w*$/, '')); + return file.path.replace(file.base + path.sep, '') + .replace(/.\w*$/, ''); }}); + return items; }