Skip to content

Commit 49f9302

Browse files
committed
Increasing priority of pass to remove before Twig tries to use it
1 parent b8ff4a6 commit 49f9302

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/WebpackEncoreBundle.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Symfony\WebpackEncoreBundle;
1111

12+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
1213
use Symfony\Component\DependencyInjection\ContainerBuilder;
1314
use Symfony\Component\HttpKernel\Bundle\Bundle;
1415
use Symfony\WebpackEncoreBundle\DependencyInjection\Compiler\RemoveStimulusServicesPass;
@@ -17,6 +18,7 @@ final class WebpackEncoreBundle extends Bundle
1718
{
1819
public function build(ContainerBuilder $container)
1920
{
20-
$container->addCompilerPass(new RemoveStimulusServicesPass());
21+
// run before TwigEnvironmentPass to remove the twig extension before it's used
22+
$container->addCompilerPass(new RemoveStimulusServicesPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
2123
}
2224
}

0 commit comments

Comments
 (0)