summaryrefslogtreecommitdiff
path: root/platform/javascript/export
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-03-11 11:55:28 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-03-11 16:09:31 +0100
commit919bbf8077e25b9250bf3ee84220b3c4b46a3e3f (patch)
treea4f6f9774b058982c075be89603be5fd303c2b6f /platform/javascript/export
parent87d50da9fc6d8e2ed6b09e830bae9473c5a13388 (diff)
[HTML5] Refactor JS, threads support, closures.
- Refactored the Engine code, splitted across files. - Use MODULARIZE option to build emscripten code into it's own closure. - Enable lto support (saves ~2MiB in release). - Enable optional closure compiler pass for JS and generated code. - Enable optional pthreads support. - Can now build with tools=yes (not much to see yet). - Dropped some deprecated code for older toolchains.
Diffstat (limited to 'platform/javascript/export')
-rw-r--r--platform/javascript/export/export.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index f0326d5027..da61425747 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -94,6 +94,9 @@ public:
} else if (req[1] == basereq + ".js") {
filepath += ".js";
ctype = "application/javascript";
+ } else if (req[1] == basereq + ".worker.js") {
+ filepath += ".worker.js";
+ ctype = "application/javascript";
} else if (req[1] == basereq + ".pck") {
filepath += ".pck";
ctype = "application/octet-stream";
@@ -432,6 +435,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
} else if (file == "godot.js") {
file = p_path.get_file().get_basename() + ".js";
+ } else if (file == "godot.worker.js") {
+
+ file = p_path.get_file().get_basename() + ".worker.js";
+
} else if (file == "godot.wasm") {
file = p_path.get_file().get_basename() + ".wasm";
@@ -563,6 +570,7 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese
// Export generates several files, clean them up on failure.
DirAccess::remove_file_or_error(basepath + ".html");
DirAccess::remove_file_or_error(basepath + ".js");
+ DirAccess::remove_file_or_error(basepath + ".worker.js");
DirAccess::remove_file_or_error(basepath + ".pck");
DirAccess::remove_file_or_error(basepath + ".png");
DirAccess::remove_file_or_error(basepath + ".wasm");