diff options
Diffstat (limited to 'platform/javascript/emscripten_helpers.py')
-rw-r--r-- | platform/javascript/emscripten_helpers.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/platform/javascript/emscripten_helpers.py b/platform/javascript/emscripten_helpers.py index b3b15a1574..ab98838e20 100644 --- a/platform/javascript/emscripten_helpers.py +++ b/platform/javascript/emscripten_helpers.py @@ -1,4 +1,4 @@ -import os +import os, json from SCons.Util import WhereIs @@ -59,7 +59,23 @@ def create_template_zip(env, js, wasm, extra): if env["tools"]: # HTML html = "#misc/dist/html/editor.html" - subst_dict = {"@GODOT_VERSION@": get_build_version(), "@GODOT_NAME@": "GodotEngine"} + cache = [ + "godot.tools.html", + "offline.html", + "godot.tools.js", + "godot.tools.worker.js", + "godot.tools.audio.worklet.js", + "logo.svg", + "favicon.png", + ] + opt_cache = ["godot.tools.wasm"] + subst_dict = { + "@GODOT_VERSION@": get_build_version(), + "@GODOT_NAME@": "GodotEngine", + "@GODOT_CACHE@": json.dumps(cache), + "@GODOT_OPT_CACHE@": json.dumps(opt_cache), + "@GODOT_OFFLINE_PAGE@": "offline.html", + } html = env.Substfile(target="#bin/godot${PROGSUFFIX}.html", source=html, SUBST_DICT=subst_dict) in_files.append(html) out_files.append(zip_dir.File(binary_name + ".html")) @@ -82,6 +98,10 @@ def create_template_zip(env, js, wasm, extra): # HTML in_files.append("#misc/dist/html/full-size.html") out_files.append(zip_dir.File(binary_name + ".html")) + in_files.append(service_worker) + out_files.append(zip_dir.File(binary_name + ".service.worker.js")) + in_files.append("#misc/dist/html/offline-export.html") + out_files.append(zip_dir.File("godot.offline.html")) zip_files = env.InstallAs(out_files, in_files) env.Zip( |