diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 1865136c76..71f9342a90 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -238,7 +238,7 @@ 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' || $dependencyName === 'Icinga') { // exports is a special keyword and doesn't need optimization continue; } diff --git a/public/js/icinga.js b/public/js/icinga.js index e8b8bccc88..3587c68ebb 100644 --- a/public/js/icinga.js +++ b/public/js/icinga.js @@ -86,6 +86,8 @@ return false; } + define('Icinga', [], () => Icinga); + this.timezone = new Icinga.Timezone(); this.utils = new Icinga.Utils(this); this.logger = new Icinga.Logger(this);