Skip to content

Commit d5a05a2

Browse files
riebecjCasey Riebemasenf
authored
Allow overriding files with Plugins, just warn about it (#6476)
* Allow overriding files with Plugins, just warn about it * Adding static asset overrides too * revert pyi_hashes.json change * actually revert pyi_hashes.json? --------- Co-authored-by: Casey Riebe <cjriebe@sbgtv.com> Co-authored-by: Masen Furer <m_github@0x26.net>
1 parent 414af15 commit d5a05a2

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

reflex/compiler/compiler.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,22 +1246,20 @@ def add_save_task(
12461246
path = utils.resolve_path_of_web_dir(output_path)
12471247
if path in output_mapping:
12481248
console.warn(
1249-
f"Path {path} has two different outputs. The first one will be used."
1249+
f"Path {path} has two different outputs. The last one will be used."
12501250
)
1251-
else:
1252-
output_mapping[path] = code
1251+
output_mapping[path] = code
12531252

12541253
for plugin in config.plugins:
12551254
for static_file_path, content in plugin.get_static_assets():
12561255
path = utils.resolve_path_of_web_dir(static_file_path)
12571256
if path in output_mapping:
12581257
console.warn(
1259-
f"Plugin {plugin.__class__.__name__} is trying to write to {path} but it already exists. The plugin file will be ignored."
1260-
)
1261-
else:
1262-
output_mapping[path] = (
1263-
content.decode("utf-8") if isinstance(content, bytes) else content
1258+
f"Plugin {plugin.__class__.__name__} is overwriting existing files at {path}."
12641259
)
1260+
output_mapping[path] = (
1261+
content.decode("utf-8") if isinstance(content, bytes) else content
1262+
)
12651263

12661264
for plugin_name, file_path, modify_fn in modify_files_tasks:
12671265
path = utils.resolve_path_of_web_dir(file_path)

0 commit comments

Comments
 (0)