Compile without re-processing assets?

I’m working on a project with a ton of swf assets, and at the moment a fresh compile crunches through re-processing all of these every time, when actually 99% of my compilations are just code changes.

Is there a way to tell the compiler to not do this and just compile the code? I assumed there’d be a flag or command or something but I can’t find much.

Thanks! :slight_smile:

1 Like

Here’s the default behavior:

  1. Assets will be copied if the modified time is newer than the output folder (or it does not exist in the output folder)
  2. SWF libraries will be processed if there is no cache present (from a previous build) or the modified time of the SWF tools is newer than the cache

What target are you using? You could consider trying openfl test html5 -npm to use the NPM hot-reload functionality to recompile automatically when the code changes (and not perform asset copies/processing at all)

So, on further inspection I think I have something more strange going on. I’ve noticed that during compilation I’m getting tons of duplicate assets in my build. My current project has around 20 images in it, but in the final preload when I test with -verbose I can see it preloading over 300. If I look at the files many of these are duplicates, for example I have a background image that’s instantiated only once in the code, but is included tons of times in the final assets with lots of different names.

Interestingly on my other mac this doesn’t appear to be the case, or on my Windows box, it’s just this machine that’s doing it. I’m using the latest versions of everything (I did an update last night just to make sure).

Any idea what could be causing this?

Is it possible you have overlapping <assets /> tags?

For example the following will pull in assets twice:

<assets path="Assets" />
<assets path="Assets/bitmaps" type="image" />