瀏覽代碼

Don't purge web dir if flag is set (#2529)

Nikhil Rao 1 年之前
父節點
當前提交
51a9b75141
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      reflex/compiler/compiler.py

+ 6 - 1
reflex/compiler/compiler.py

@@ -460,7 +460,12 @@ def remove_tailwind_from_postcss() -> tuple[str, str]:
 
 
 
 
 def purge_web_pages_dir():
 def purge_web_pages_dir():
-    """Empty out .web directory."""
+    """Empty out .web/pages directory."""
+    if _is_dev_mode() and os.environ.get("REFLEX_PERSIST_WEB_DIR"):
+        # Skip purging the web directory in dev mode if REFLEX_PERSIST_WEB_DIR is set.
+        return
+
+    # Empty out the web pages directory.
     utils.empty_dir(constants.Dirs.WEB_PAGES, keep_files=["_app.js"])
     utils.empty_dir(constants.Dirs.WEB_PAGES, keep_files=["_app.js"])