I am building an application composed of a set of modules that get loaded when the application bootstrap:
const MODULES = [] function registerModules(config) { return modules.map(module => (new module(config)).install()); } function bootstrap() { MODULES = registerModules({...}); } The above of-course will raise an error. What I want to do is to assign the MODULE constant only when the app start but then it should be fixed. Is this possible?
Initialisation of MODULES has to happen inside bootstrap because of the config variable that I have to pass to registerModules.