LiipThemeBundle icon indicating copy to clipboard operation
LiipThemeBundle copied to clipboard

Assetic write-to (conflict for resources with same name)

Open yellow1912 opened this issue 10 years ago • 3 comments

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?

yellow1912 avatar Oct 19 '13 17:10 yellow1912

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.

yellow1912 avatar Oct 19 '13 17:10 yellow1912

@kriswallsmith do you have a hint here maybe?

lsmith77 avatar Oct 19 '13 20:10 lsmith77

ping

lsmith77 avatar Jul 17 '14 09:07 lsmith77