fix: fix logs for plugins loaded with plugins option

This commit is contained in:
Pierre Vanduynslager 2018-10-09 16:08:17 -04:00
parent ff275a5cd4
commit 58c25beeb6

View File

@ -19,7 +19,11 @@ module.exports = (context, pluginsPath) => {
if (isPlainObject(plugin)) {
Object.entries(plugin).forEach(([type, func]) => {
if (PLUGINS_DEFINITIONS[type]) {
Reflect.defineProperty(func, 'pluginName', {value: 'Inline plugin', writable: false, enumerable: true});
Reflect.defineProperty(func, 'pluginName', {
value: isPlainObject(name) ? 'Inline plugin' : name,
writable: false,
enumerable: true,
});
plugins[type] = [...(PLUGINS_DEFINITIONS[type].multiple ? plugins[type] || [] : []), [func, config]];
}
});