merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi
About | Files | Commits | Refs | License
fix: reload plugin modules fresh on each build to avoid stale cache
Author: pi66
Date: 2026-07-04 22:59
commit: 08f47ab3
Stat
| A | src/build.py | 5 | +5 | -0 |
Diff
diff --git a/src/build.py b/src/build.py
index cf4bbfb..45efff4 100644
--- a/src/build.py
+++ b/src/build.py
@@ -29,8 +29,13 @@ def load_plugins(path):
module_dir = dirname(abspath(path))
sys.path.insert(0, module_dir)
try:
+ for name in list(sys.modules):
+ mod_file = getattr(sys.modules[name], "__file__", "") or ""
+ if mod_file.startswith(module_dir):
+ del sys.modules[name]
spec = importlib.util.spec_from_file_location("plugins", path)
module = importlib.util.module_from_spec(spec)
+ module.CONFIG = settings.CONFIG
spec.loader.exec_module(module)
return {