modify absoluteJsImportUrl helper to add buildversion to path if config is set

This commit is contained in:
Harald Bamberger
2026-03-04 16:51:52 +01:00
parent 183ffdafd8
commit edeb211247
2 changed files with 19 additions and 6 deletions
@@ -113,6 +113,7 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
'modes'=>$ci->config->item('theme_modes'),
],
'fhcomplete_build_version' => $ci->config->item('fhcomplete_build_version'),
'use_fhcomplete_build_version_in_path' => $ci->config->item('use_fhcomplete_build_version_in_path'),
);
$toPrint = "\n";
+18 -6
View File
@@ -1,10 +1,22 @@
const absoluteJsImportUrl = function(relativeurl)
{
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ relativeurl
+ '?'
+ FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version;
return absoluteurl;
}
if(true === FHC_JS_DATA_STORAGE_OBJECT.use_fhcomplete_build_version_in_path)
{
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ relativeurl.replace(
/^public\//,
'public/' + FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version + '/'
);
return absoluteurl;
}
else
{
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ relativeurl
+ '?'
+ FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version;
return absoluteurl;
}
};
export { absoluteJsImportUrl };