From d7f98d7b8f047374f74462f2793fa245d642ce92 Mon Sep 17 00:00:00 2001 From: Burer Date: Sun, 5 Oct 2025 11:23:14 +0300 Subject: [PATCH] feat/flask: compile sass only in debug mod --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index b19f51c..5f1a499 100644 --- a/app.py +++ b/app.py @@ -22,9 +22,10 @@ STATUS_FETCH_DELAY_SEC = 300 # 5 minutes app = Flask(__name__) -css = sass.compile(filename="static/style.scss") -with open("static/style.css", "w", encoding="utf-8") as f: - f.write(css) +if app.debug: + css = sass.compile(filename="static/style.scss") + with open("static/style.css", "w", encoding="utf-8") as f: + f.write(css) # ---------- LATEST COMMIT DATE (MINIMAL ADD-ON) -----------------------------