shellphone.app/server/purge-require-cache.ts

9 lines
194 B
TypeScript
Raw Permalink Normal View History

export function purgeRequireCache() {
const resolved = require.resolve("../build");
for (const key in require.cache) {
if (key.startsWith(resolved)) {
delete require.cache[key];
}
}
}