fix: use module name in logs for plugins loaded with plugins option

This commit is contained in:
Pierre Vanduynslager
2018-10-09 15:29:04 -04:00
parent 3e8216ab35
commit ff275a5cd4
4 changed files with 15 additions and 14 deletions
+1
View File
@@ -19,6 +19,7 @@ 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});
plugins[type] = [...(PLUGINS_DEFINITIONS[type].multiple ? plugins[type] || [] : []), [func, config]];
}
});