diff --git a/Source/Editor/Cooker/Platform/Web/WebPlatformTools.cpp b/Source/Editor/Cooker/Platform/Web/WebPlatformTools.cpp index a9ac29503..dfb0b5403 100644 --- a/Source/Editor/Cooker/Platform/Web/WebPlatformTools.cpp +++ b/Source/Editor/Cooker/Platform/Web/WebPlatformTools.cpp @@ -147,10 +147,19 @@ bool WebPlatformTools::OnPostProcess(CookingData& data) } const String insertPrefixLocation = TEXT("// end include: minimum_runtime_check.js"); int32 location = gameJsText.Find(insertPrefixLocation); - CHECK_RETURN(location != -1, true); - location += insertPrefixLocation.Length() + 1; - fileJsText = filesIncludeBegin + TEXT("\n") + fileJsText + TEXT("\n") + filesIncludeEnd + TEXT("\n"); - gameJsText.Insert(location, fileJsText); + if (location != -1) + { + location += insertPrefixLocation.Length() + 1; + fileJsText = filesIncludeBegin + TEXT("\n") + fileJsText + TEXT("\n") + filesIncludeEnd + TEXT("\n"); + gameJsText.Insert(location, fileJsText); + } + else + { + // Comments are missing in Release when JS/HTML are minified + fileJsText.Insert(0, filesIncludeBegin); + fileJsText.Insert(0, TEXT("\n")); + gameJsText.Insert(0, fileJsText); + } File::WriteAllText(gameJs, gameJsText, Encoding::UTF8); } diff --git a/Source/Engine/Platform/Web/WebPlatform.cpp b/Source/Engine/Platform/Web/WebPlatform.cpp index 8110efe57..4400d1af9 100644 --- a/Source/Engine/Platform/Web/WebPlatform.cpp +++ b/Source/Engine/Platform/Web/WebPlatform.cpp @@ -6,16 +6,14 @@ #include "WebFileSystem.h" #include "Engine/Core/Log.h" #include "Engine/Core/Types/String.h" +#include "Engine/Core/Types/StringView.h" #include "Engine/Core/Types/Version.h" #include "Engine/Core/Types/Guid.h" #include "Engine/Core/Collections/Dictionary.h" #include "Engine/Platform/CPUInfo.h" #include "Engine/Platform/MemoryStats.h" #include "Engine/Profiler/ProfilerCPU.h" -#if !BUILD_RELEASE -#include "Engine/Core/Types/StringView.h" #include "Engine/Utilities/StringConverter.h" -#endif #include #include #include