[config/plugins] move plugin config setup to prevent invalid warning
This commit is contained in:
parent
bf171233bf
commit
b3c2a8f95b
|
@ -13,7 +13,7 @@ module.exports = class Plugins extends Collection {
|
|||
this.kbnServer = kbnServer;
|
||||
}
|
||||
|
||||
new(path) {
|
||||
async new(path) {
|
||||
var api = new PluginApi(this.kbnServer, path);
|
||||
let output = [].concat(require(path)(api) || []);
|
||||
|
||||
|
@ -21,6 +21,7 @@ module.exports = class Plugins extends Collection {
|
|||
if (product instanceof api.Plugin) {
|
||||
this[byIdCache] = null;
|
||||
this.add(product);
|
||||
await product.setupConfig();
|
||||
} else {
|
||||
throw new TypeError('unexpected plugin export ' + inspect(product));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ module.exports = async function (kbnServer, server, config) {
|
|||
|
||||
// setup config and filter out disabled plugins
|
||||
for (let plugin of plugins) {
|
||||
await plugin.setupConfig();
|
||||
if (config.get([plugin.id, 'enabled'])) {
|
||||
enabledPlugins[plugin.id] = plugin;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ module.exports = async (kbnServer, server, config) => {
|
|||
}
|
||||
|
||||
require(modulePath);
|
||||
plugins.new(path);
|
||||
await plugins.new(path);
|
||||
debug({ tmpl: 'Found plugin at <%= path %>', path: modulePath });
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue