UNPKG

650 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const log_1 = __importDefault(require("./log"));
7function clearNodeCache(rootPath) {
8 Object.keys(require.cache).forEach((key) => {
9 var _a;
10 if ((_a = require.cache[key]) === null || _a === void 0 ? void 0 : _a.filename.startsWith(rootPath)) {
11 log_1.default.debug("delete node-cache for", key);
12 delete require.cache[key];
13 }
14 });
15}
16exports.default = clearNodeCache;