disable_preloader_assets haxedef

When the project contains no assets, excludes asset-related classes for big file size savings
This commit is contained in:
Josh Tynjala
2021-11-18 10:46:07 -08:00
parent e3d49867fb
commit 0ecf27d2d6
4 changed files with 30 additions and 1 deletions

View File

@@ -18,7 +18,9 @@ import ::APP_MAIN::;
public static function create(config:Dynamic):Void
{
#if !disable_preloader_assets
ManifestResources.init(config);
#end
#if !munit
var app = new ::APP_MAIN::();
@@ -98,6 +100,7 @@ import ::APP_MAIN::;
// preloader.create ();
#if !disable_preloader_assets
for (library in ManifestResources.preloadLibraries)
{
app.preloader.addLibrary(library);
@@ -107,6 +110,7 @@ import ::APP_MAIN::;
{
app.preloader.addLibraryName(name);
}
#end
app.preloader.load();

View File

@@ -1,3 +1,4 @@
#if !disable_preloader_assets
package;
@@ -136,3 +137,5 @@ import sys.FileSystem;
#end
#end
#end