1
0
Эх сурвалжийг харах

Set REFLEX_ENV_MODE=prod for exports

Ensure that exported frontends use minified names

Set REFLEX_ENV_MODE earlier
Masen Furer 5 сар өмнө
parent
commit
5ae1541aa9
1 өөрчлөгдсөн 8 нэмэгдсэн , 0 устгасан
  1. 8 0
      reflex/reflex.py

+ 8 - 0
reflex/reflex.py

@@ -316,6 +316,10 @@ def export(
     ),
 ):
     """Export the app to a zip file."""
+    # Set env mode in the environment
+    # This must be set before importing modules that contain rx.State subclasses
+    environment.REFLEX_ENV_MODE.set(constants.Env.PROD)
+
     from reflex.utils import export as export_utils
     from reflex.utils import prerequisites
 
@@ -662,6 +666,10 @@ def deployv2(
     ),
 ):
     """Deploy the app to the Reflex hosting service."""
+    # Set env mode in the environment
+    # This must be set before importing modules that contain rx.State subclasses
+    environment.REFLEX_ENV_MODE.set(constants.Env.PROD)
+
     from reflex_cli.v2 import cli as hosting_cli
     from reflex_cli.v2.utils import dependency