Skip to content

Commit

Permalink
bug #72 Bugfix: Properly add tags to services (Nyholm)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Bugfix: Properly add tags to services

We need to make sure we can reset all resettable services.

Commits
-------

3a3eac3 Properly add tags to services
  • Loading branch information
weaverryan committed Jul 1, 2019
2 parents 767a215 + 3a3eac3 commit f0f4244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DependencyInjection/WebpackEncoreExtension.php
Expand Up @@ -82,7 +82,9 @@ private function entrypointFactory(ContainerBuilder $container, string $name, st
$name,
$strictMode,
];
$container->setDefinition($id, new Definition(EntrypointLookup::class, $arguments));
$definition = new Definition(EntrypointLookup::class, $arguments);
$definition->addTag('kernel.reset', ['method'=>'reset']);
$container->setDefinition($id, $definition);

return new Reference($id);
}
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/services.xml
Expand Up @@ -14,6 +14,7 @@
<service id="Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollectionInterface" alias="webpack_encore.entrypoint_lookup_collection" />

<service id="webpack_encore.tag_renderer" class="Symfony\WebpackEncoreBundle\Asset\TagRenderer">
<tag name="kernel.reset" method="reset" />
<argument type="service" id="webpack_encore.entrypoint_lookup_collection" />
<argument type="service" id="assets.packages" />
<argument type="collection" />
Expand Down

0 comments on commit f0f4244

Please sign in to comment.