From 4431af91538c2454a77ff5323d76de2a10b0329d Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Mon, 30 Sep 2024 11:27:43 -0400 Subject: Fix web export infinite reload issue --- platform/web/export/export_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'platform/web/export/export_plugin.cpp') diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index 5faab74d7b..efe3c95496 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -214,6 +214,9 @@ Error EditorExportPlatformWeb::_add_manifest_icon(const String &p_path, const St } Error EditorExportPlatformWeb::_build_pwa(const Ref &p_preset, const String p_path, const Vector &p_shared_objects) { + List preset_features; + get_preset_features(p_preset, &preset_features); + String proj_name = GLOBAL_GET("application/config/name"); if (proj_name.is_empty()) { proj_name = "Godot Game"; @@ -239,7 +242,10 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref &p_prese cache_files.push_back(name + ".icon.png"); cache_files.push_back(name + ".apple-touch-icon.png"); } - cache_files.push_back(name + ".worker.js"); + + if (preset_features.find("threads")) { + cache_files.push_back(name + ".worker.js"); + } cache_files.push_back(name + ".audio.worklet.js"); cache_files.push_back(name + ".audio.position.worklet.js"); replaces["___GODOT_CACHE___"] = Variant(cache_files).to_json_string(); -- cgit v1.2.3