Share: Copy assets to bin folder without embedding them

Problem
I had recently this problem where I wanted to copy assets to the bin folder without embedding them into the initial build load aka the Assets folder.

Solution
I used the template system and specified a folder to copy all of its content across.

  1. Create a “templates” folder
    I created a folder “templates” that contains the following
    ┬ templates
    └─┬ html5
    …└─┬ template
    …└── {your files}
    If you want to learn what these folder structures should look like for your target platform look inside the haxe toolkit installation folder for:
    {HaxeToolkit}\haxe\lib\openfl\4,5,1\templates

  2. Setup project.xml
    Inside the project.xml I added the tag
    <template path="templates" />
    Which tells the compiler to search inside the templates folder for each target platform and copy the template files to the bin folder.

For reference, here is a setup from my html5 project:

Background
I found a related thread but the only solution offered in there was how to copy just individual files. And because it was very hard for me to find any solutions to this particular issue I decided to post this thread in hope that it might be of use to someone else.

Related archived post with solution on how to copy individual files
http://www.openfl.org/archive/community/programming-haxe/copy-assets-bin-folder/

Does <assets path="" embed="false" /> work alright?

It should allow you to Assets.loadBitmapData (etc) without it affecting preload times