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

This commit is contained in:
Nikhil Rao 2024-02-07 05:27:44 +07:00 committed by GitHub
parent e2c3081d1e
commit 51a9b75141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -460,7 +460,12 @@ def remove_tailwind_from_postcss() -> tuple[str, str]:
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"])