Merge pull request #326 from ioga/assets-prefix
Support custom prefix (root) for resources URLs in html5.
This commit is contained in:
@@ -32,6 +32,8 @@ class ApplicationMain {
|
||||
::else::types.push (null);::end::
|
||||
::end::::end::
|
||||
|
||||
urls = [for (url in urls) Assets.getPath(url)];
|
||||
|
||||
preloader.load (urls, types);
|
||||
#end
|
||||
|
||||
@@ -99,4 +101,4 @@ class ApplicationMain {
|
||||
#end
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,13 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
type.set (id, AssetType.$$upper(::type::));
|
||||
::end::::end::
|
||||
|
||||
var assetsPrefix = ApplicationMain.config.assetsPrefix;
|
||||
if (assetsPrefix != null) {
|
||||
for (k in path.keys()) {
|
||||
path.set(k, assetsPrefix + path[k]);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if openfl
|
||||
|
||||
Reference in New Issue
Block a user