Closed
Description
Hi!
If you're using StimulusBundle with asset mapper, if you add a new file to assets/controllers/
, it's not seen immediately. You need to either run bin/console cache:clear
or make some change to an existing controller.
This is due to AssetMapper's caching system. In https://github.com/symfony/ux/blob/2.x/src/StimulusBundle/src/AssetMapper/StimulusLoaderJavaScriptCompiler.php, we need a way to add a DirectoryResource
to the resource for the asset - https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/AssetMapper/Factory/CachedMappedAssetFactory.php#L60
So, we'll need a tweak in Symfony's core then we'll need to take advantage of it.
I believe we also need to add a normal FileDependency
for assets/controllers.json
.