Closed haikyuu closed 9 years ago
Thanks @AdriVanHoudt . I borrowed your test which alters the register function of the plugin, nice trick (i totally forgot that the required modules were cached).
Wouldn't it be nice if we required all the plugins in the lib folder and registered them once. We could use require-dir or something like
Fs.readdirSync(__dirname).filter(function(file) {
return ((file !== 'index.js') && (file.indexOf('.js') !== -1);
}).forEach(function(file) {
internals.plugins.push(require(Path.join(__dirname, file)));
});
@haikyuu np and we register them once right now...
@AdriVanHoudt i meant that we shouldn't have to update the index.js file every time we add a plugin.
@haikyuu seems logical to me, since every plugin has specific options, we can however in the future use https://github.com/hapijs/glue