diff --git a/src/Icons/src/DependencyInjection/UXIconsExtension.php b/src/Icons/src/DependencyInjection/UXIconsExtension.php index 81042277976..85672aebeec 100644 --- a/src/Icons/src/DependencyInjection/UXIconsExtension.php +++ b/src/Icons/src/DependencyInjection/UXIconsExtension.php @@ -173,16 +173,15 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container $container->getDefinition('.ux_icons.iconify_on_demand_registry') ->setArgument(1, $iconSetAliases); + $container->getDefinition('.ux_icons.command.lock') + ->setArgument(3, $mergedConfig['aliases']) + ->setArgument(4, $iconSetAliases); + if (!$mergedConfig['iconify']['on_demand']) { $container->removeDefinition('.ux_icons.iconify_on_demand_registry'); } } - $container->getDefinition('.ux_icons.command.lock') - ->setArgument(3, $mergedConfig['aliases']) - ->setArgument(4, $iconSetAliases) - ; - if (!$container->getParameter('kernel.debug')) { $container->removeDefinition('.ux_icons.command.import'); }