fix: #1574 & Clear CJS cache and reload plugins on install

Add support for clearing CommonJS module cache when unloading plugins and reload plugins on install. PluginLoader now uses createRequire to access require.cache and exposes clearCache(pluginPath) to remove cached modules under the plugin directory; plugin manager calls this when unloading. Web UI backend install handlers now reload an existing plugin (with progress updates) instead of skipping registration, ensuring updated code/metadata take effect.
This commit is contained in:
手瓜一十雪 committed 2026-02-02 14:14:06 +08:00
1 parent d4fee6798c
commit 5fac30afd8
3 files changed
+36 -6

No files matched your search

@@ -179,6 +179,9 @@ export class OB11PluginMangerAdapter extends IOB11NetworkAdapter<PluginConfig> i
this.pluginRouters.delete(entry.id);
}
// 清理模块缓存
this.loader.clearCache(entry.pluginPath);
// 重置状态
entry.loaded = false;
entry.runtime = {