Skip to content

Commit

Permalink
Increasing priority of pass to remove before Twig tries to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed May 29, 2023
1 parent b8ff4a6 commit 49f9302
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/WebpackEncoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Symfony\WebpackEncoreBundle;

use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\WebpackEncoreBundle\DependencyInjection\Compiler\RemoveStimulusServicesPass;
Expand All @@ -17,6 +18,7 @@ final class WebpackEncoreBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new RemoveStimulusServicesPass());
// run before TwigEnvironmentPass to remove the twig extension before it's used
$container->addCompilerPass(new RemoveStimulusServicesPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
}
}

0 comments on commit 49f9302

Please sign in to comment.