fix imports with alias from $ (#4332)

This commit is contained in:
Khaleel Al-Adhami 2024-11-07 19:17:07 -08:00 committed by GitHub
parent 4c4c59bf04
commit a454b705a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,9 +111,9 @@ def load_dynamic_serializer():
if line.startswith("import "):
if 'from "$/' in line or 'from "/' in line:
module_code_lines[ix] = (
line.replace("import ", "const ", 1).replace(
" from ", " = window['__reflex'][", 1
)
line.replace("import ", "const ", 1)
.replace(" as ", ": ")
.replace(" from ", " = window['__reflex'][", 1)
+ "]"
)
else: