only cache AsyncEmbeddedScript with kissCache
This commit is contained in:
@@ -246,12 +246,14 @@ class AsyncEmbeddedScript {
|
|||||||
|
|
||||||
var hscriptInstructions:Map<String,String> = [];
|
var hscriptInstructions:Map<String,String> = [];
|
||||||
var cache:Map<String,String> = [];
|
var cache:Map<String,String> = [];
|
||||||
|
#if kissCache
|
||||||
var cacheFile = scriptFile.withoutExtension().withoutDirectory() + ".cache.json";
|
var cacheFile = scriptFile.withoutExtension().withoutDirectory() + ".cache.json";
|
||||||
if (sys.FileSystem.exists(cacheFile)) {
|
if (sys.FileSystem.exists(cacheFile)) {
|
||||||
var cacheJson:haxe.DynamicAccess<String> = haxe.Json.parse(sys.io.File.getContent(cacheFile));
|
var cacheJson:haxe.DynamicAccess<String> = haxe.Json.parse(sys.io.File.getContent(cacheFile));
|
||||||
for (key => value in cacheJson)
|
for (key => value in cacheJson)
|
||||||
cache[key] = value;
|
cache[key] = value;
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
var hscriptInstructionFile = scriptFile.withoutExtension().withoutDirectory() + ".hscript.json";
|
var hscriptInstructionFile = scriptFile.withoutExtension().withoutDirectory() + ".hscript.json";
|
||||||
|
|
||||||
@@ -379,8 +381,10 @@ class AsyncEmbeddedScript {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#if kissCache
|
||||||
sys.io.File.saveContent(cacheFile, haxe.Json.stringify(cache));
|
sys.io.File.saveContent(cacheFile, haxe.Json.stringify(cache));
|
||||||
sys.io.File.saveContent(hscriptInstructionFile, haxe.Json.stringify(hscriptInstructions));
|
sys.io.File.saveContent(hscriptInstructionFile, haxe.Json.stringify(hscriptInstructions));
|
||||||
|
#end
|
||||||
|
|
||||||
return classFields;
|
return classFields;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user