diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 1865136c76..1c09a1e680 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -238,8 +238,9 @@ public static function optimizeDefine($js, $filePath, $basePath, $packageName) try { $dependencies = $match[2] ? Json::decode($match[2]) : []; foreach ($dependencies as &$dependencyName) { - if ($dependencyName === 'exports') { + if ($dependencyName === 'exports' || str_starts_with($dependencyName, 'icinga/legacy-app/')) { // exports is a special keyword and doesn't need optimization + // 'app/legacy-app/...' is a custom-defined path and doesn’t need optimization either. continue; } diff --git a/public/js/icinga.js b/public/js/icinga.js index a0e060ecfb..634fc9a52c 100644 --- a/public/js/icinga.js +++ b/public/js/icinga.js @@ -100,6 +100,8 @@ this.events = new Icinga.Events(this); this.history = new Icinga.History(this); + define("icinga/legacy-app/Icinga", [], () => Icinga); + // Initialize all available behaviors for (const name in Icinga.Behaviors) { const behavior = new Icinga.Behaviors[name](this);