I have been trying to get this to work for the last week with no joy :(
I am loading modules dynamically using
var req = require.context("../jobs", true, /.js$/);
req.keys().map(req).forEach((worker) =>{ /*do stuff*/ });
Now I want to expose a Config object with in all the files I am including. !With out require with in the file or explicitly passing it in and fill the function arguments!
Like using the bind function to set the this context.
and lets as we have a file: /jobs/foo.js
'use strict'
module.exports = function(){ Config... }
Thank you for any help
