I’m trying to reduce the size of the .js output of a basic html5 build, but still ending up with huge .js filesizes ! , I’d really like to find out how i can reduce the output as much as possible.
I’ve updated today to Lime 2.6.9, openfl 3.3.9 , actuate 1.8.6, which is the latest build. I’ve created a brand new empty project. I’ve edited the main.hx so that all that the project does is trace “Hello World” (it doesn’t even import any libraries anymore or extend sprite); in the hope i can output the smallest possible .js file.
Main.hx now looks like this:
package;
class Main
{
public function new()
{
trace("hello World");
}
}
Choosing Debug and html5 in flashdevelop produces a .js output which is a whopping 1371 KB !. (strangely choosing release gives the same filesize)
I’ve spent a couple of hours playing with the Dead Code Elimination , js-flatten, and minify compiler options etc. some of which reduce the output file size, (trying -final causes an error, unless -minify is also used? ) the best results i found having tried many manu combinations where
adding dce full to the project.xml file
<haxeflag name="-dce full" />
which bring the output .js size down to a still huge 537KB
and also using the compile line to compile with -minify -yui (where performancetest is my project name)
openfl build html5 -Dperformancetest -minify -yui
which brings the output size down further to a still huge 305KB ! which is still massive.
From what i can see, both of these create the 1371KB file first, then work a little magic on it to reduce the size, which whilst it does reduce the size a bit, still leaves it massively larger than it needs to be.
I’m stuck as to where i can go next to reduce the size further , Help !
Edit : over here it talks about BunnyMark being reduced to 22KB ?
http://www.openfl.org/blog/2014/03/18/flash-and-html5/