diff --git a/lib/plugins/loader.js b/lib/plugins/loader.js index 04d185d..96bc2bf 100644 --- a/lib/plugins/loader.js +++ b/lib/plugins/loader.js @@ -750,9 +750,12 @@ class PluginsLoader { logger.mark(`[卸载插件][${dirName}][${appName}]`) /** 停止更新监听 */ this.watcher[`${dirName}.${appName}`].removeAllListeners('change') - for (const i in this.priority) - if (this.priority[i].key == key) + // lodash.remove(this.priority, { key }) + for (let i = this.priority.length - 1; i >= 0; i--) { + if (this.priority[i].key === key) { this.priority.splice(i, 1) + } + } }) this.watcher[`${dirName}.${appName}`] = watcher }