HTML5 asset optimization
This commit is contained in:
@@ -361,6 +361,9 @@ class HTML5Platform extends PlatformTarget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var createdDirectories = new Map<String, Bool>();
|
||||||
|
var dir = null;
|
||||||
|
|
||||||
for (asset in project.assets)
|
for (asset in project.assets)
|
||||||
{
|
{
|
||||||
var path = Path.combine(destination, asset.targetPath);
|
var path = Path.combine(destination, asset.targetPath);
|
||||||
@@ -369,7 +372,12 @@ class HTML5Platform extends PlatformTarget
|
|||||||
{
|
{
|
||||||
if ( /*asset.embed != true &&*/ asset.type != AssetType.FONT)
|
if ( /*asset.embed != true &&*/ asset.type != AssetType.FONT)
|
||||||
{
|
{
|
||||||
System.mkdir(Path.directory(path));
|
dir = Path.directory(path);
|
||||||
|
if (!createdDirectories.exists(dir))
|
||||||
|
{
|
||||||
|
System.mkdir(dir);
|
||||||
|
createdDirectories.set(dir, true);
|
||||||
|
}
|
||||||
AssetHelper.copyAssetIfNewer(asset, path);
|
AssetHelper.copyAssetIfNewer(asset, path);
|
||||||
}
|
}
|
||||||
else if (asset.type == AssetType.FONT && useWebfonts)
|
else if (asset.type == AssetType.FONT && useWebfonts)
|
||||||
|
|||||||
Reference in New Issue
Block a user