Enabling DCE for JS project [SOLVED]

Hi there,
I’m new to haxe, just set up my first Open FL project, trying to find where to add “-dce full” compiler option to turn on the Dead Code Elimination feature. My guess is that I need to add it somewhere in myproject.hxproj file, right? I’ve added it in < build >< option additional=" >>>HERE<<< " / ></ build > but with no effect, my JS file is still > 1mb.
Where do I add compiler options (I use Intellij Idea)?
Thanks in advance.

You can put this in your application.xml / project.xml:

<haxeflag name="-dce full" />


It worked!
Thanks Ian!

Also try -final when building to enable DCE and minification:

openfl test html5 -final

It should be slower to build, but a better file size for delivery :slight_smile: