LiipThemeBundle
LiipThemeBundle copied to clipboard
Assetic write-to (conflict for resources with same name)
I wonder if anyone ran into this issue before: with the current setting there is no theme-specific path for write_to which means if your themes share the same asset filenames place in the same structure then assetic will generate the same output files. This is a big problem if you consider dynamically changing active theme per request.
I'm trying to find out how to get around this issue. The first thing would be determining how assetic generates its asset_url and making sure it must be theme-aware. Then assetic:dump must also dump assets to the correct place (I guess I can override the assetic:dump command for this).
Any suggestion?
I think I found away, not sure if it is ugly or not but... I think I can override Symfony\Bundle\AsseticBundle\Twig\AsseticExtension (using DI service of course). The exact method I need to override will be createTokenParser which will allow me to make it theme-aware.
Perhaps there is a better way to do this? The ouput is already relative to the write_to it seems, there must be a better place to override this.
@kriswallsmith do you have a hint here maybe?
ping