Merge pull request #21514 from mattwire/1624_2319_casedashboard
[civicrm-core.git] / ang / crmUi.ang.php
index 1e4306d32b165fcf225b7fd1ac53ed751c4bcb52..21663021634d89693d2ec4427dc745da628f1262 100644 (file)
@@ -1,14 +1,18 @@
 <?php
 // This file declares an Angular module which can be autoloaded
-// in CiviCRM. See also:
-// http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules
+$isDebug = Civi::settings()->get('debug_enabled');
 
-return array(
+return [
   'ext' => 'civicrm',
-  'js' => array('ang/crmUi.js'),
-  'partials' => array('ang/crmUi'),
-  'requires' => array(
-    'crmResource',
-    'ui.utils',
+  'js' => ['ang/crmUi.js'],
+  'partials' => ['ang/crmUi'],
+  'css' => ['ang/crmUI.css'],
+  'requires' => array_merge(
+    [
+      'crmResource',
+      'ui.utils',
+    ],
+    // Only require the +10kb if we're likely to need it.
+    $isDebug ? ['jsonFormatter'] : []
   ),
-);
+];