UNPKG

aki-plugin-manager

Version:

Lightweight at-runtime plugin manager and loader

14 lines (13 loc) 424 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.unload = void 0; const path_1 = require("path"); const unload = (baseDir, name, requireFn = require) => { const pluginDir = path_1.join(baseDir, name); Object.keys(requireFn.cache).forEach((item) => { if (item.startsWith(pluginDir)) { delete requireFn.cache[item]; } }); }; exports.unload = unload;