How to reduce HTML5 package size?
after looking into this for my own HTML5 project, I noticed that by default, the plugin configuration in the .uproject file is not allowed to disable default plugins. To fix this, edit Engine/Source/Programs/UnrealBuildTool/System/UProjectInfo.cs in GetEnabledPlugins and replace List EnabledPlugins = new List(DefaultEnabledPlugins); with List EnabledPlugins = new List(); ( for me, it's line 313 )
Then recompile while specifying the uproject file, that is using Engine/Build/BatchFiles/Mac/Build.sh UE4Game HTML5 Shipping /path/to/your.uproject instead of Engine/Build/BatchFiles/Mac/Build.sh UE4Game HTML5 Shipping
And voila, only the modules you enabled are compiled and linked into your HTML5 runtime :)
answered Apr 23 '15 at 07:57 PM
To shrink the size of a HTML5 deployment I recommend you to pre-gzip the content, I was able to get the final size to about 15 MB for the engine and the game for an HTML project (just select the big blue button https://ikea.pr/puertorico/desktop/es_pr/catalogos/categoria/escenario/detalle/apartamento-de-verano_PR).
Once you have gzipped your content (apache example: http://feeding.cloud.geek.nz/posts/serving-pre-compressed-files-using/) you have two options, always serve gzip or serving both and if the client is able to read gzip content serving the gzipped version. Deciding if the client can handle gzip is easy, just create a .js file, gzip it to .js.gzip (gzip with the -9 option which indicates best compression rates) and try to load it. If you add a variable in that file like var enable_gzip = true; and your client can load that file the enable_gzip will be defined, if not enable_gzip will be undefined and you can change the extension you request from the server.
From you file sizes the engine should go under 10 MB and the game around 6 MB.
answered Jan 14 '15 at 05:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here