In my project I use code below to add to assetic some named assets and one of them use lessphp filter.
public function prepend(ContainerBuilder $container)
{
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
$this->configureAsseticBundle($container, $config);
}
protected function configureAsseticBundle(ContainerBuilder $container, array $config)
{
foreach (array_keys($container->getExtensions()) as $name) {
switch ($name) {
case 'assetic':
$container->prependExtensionConfig(
$name,
array(
'assets' => array(
'some_less' => array(
'inputs' => array(
'@SomeBundle/Resources/public/less/some.less'
),
'filters' => array('lessphp'),
),
)
)
);
break;
}
}
}
When I dump assets using assetic:dump everything is working fine in production enviroment but in dev enviroment lessphp filter for this named asset works only after few page refresh and after some time it doesn't work anymore and I need to remove all cache. After remove cache it work fine again... for few minutes...
I also noticed that it stop working when I edit any bundle extension class (DependencyInjection/[BundleName]Extension.php).
Does anyone have any idea what i did wrong?