import { extname } from 'path'
-function decachePlugin (pluginPath: string, libraryPath: string) {
+function decachePlugin (libraryPath: string) {
const moduleName = find(libraryPath)
if (!moduleName) return
searchCache(moduleName, function (mod) {
delete require.cache[mod.id]
- })
- removeCachedPath(pluginPath)
+ removeCachedPath(mod.path)
+ })
}
function decacheModule (name: string) {
searchCache(moduleName, function (mod) {
delete require.cache[mod.id]
- })
- removeCachedPath(moduleName)
+ removeCachedPath(mod.path)
+ })
}
// ---------------------------------------------------------------------------
};
function removeCachedPath (pluginPath: string) {
- const pathCache = (module.constructor as any)._pathCache
+ const pathCache = (module.constructor as any)._pathCache as { [ id: string ]: string[] }
Object.keys(pathCache).forEach(function (cacheKey) {
if (cacheKey.includes(pluginPath)) {