I used -final to build a very small html5 app loading an image. It got reduced from 32 mb to around 16mb. However still 16 mb is a noticeable size. Are there more possibilities of size reduction?
try to use Dead Code Elimination and pray that it doesn’t break your code.
add -dce full
also add -minify
if you are on html5
Can we add these options like -dce full, -verbose, -minify or -final from project.xml.
Right now I have to edit it in the compiler text of haxedevelop editor.
Add:
<haxeflag name="dce" value="full" if="final" />
Then in FlashDevelop edit the target drop-down and write “html5 -final”
Then you will have both “html5” or “html5 -final” available in the drop-down to switch
-final
(short for “Final Release”, as opposed to debug or release configurations) implies -minify
on the HTML5 target
Is it possible to get a reference of all tags for project.xml on one page? I had found this but this does not look complete.
Any way to reference every possible tag?
That’s the docs
What’s missing?
16 mb?? 32 mb?? small html5 app? Hmm, my game (WebGL game Atlantis) with ALL resources (models, textures, js etc.) is about ~8 mb in total JS size is 2mb. I use JSCompress before uploading final release, but it saves about 1-1.5 mb, after just “Release” build i have never seen JS bigger than 3.5mb.
But i didn’t know about “-final” and DCE, I will try it as soon as possible
Thanks for your reply. I will see what is adding up so much of weight.
However when I see my files, their are some assets that do add up the size, like the fonts. I got 2 fonts, each font converts to 3 formats “eot”, “woff”, “ttf”, “svg”. And thus there come around 8 files that size to 3 mb. After that I have sounds that have got two formats mp3 and ogg, for browser compatibility. Don’t these assets add to your projects?
Ok my mistake, i thought compiler’s argument and description too needed to be listed there. But instead I will need to look the compiler’s reference for that.
If we are talking html5 not all 3 font formats are downloaded. Only the best format for the browser is downloaded. Same with audio files, if the filename is the same (eg, music.mp3, music.ogg, music.m4a, music.aac) only one file gets downloaded.
This throws an error message:
Error: Could not process argument dce full
invalid character:
<haxeflag name="-dce full" if="final" />
works as expected.
Oh perhaps it’s <haxeflag name="-dce" value="full" if="final" />