I'm working on a legacy application that we are slowly migrating to Symfony. Currently Symfony2.6 (due to PHP version), but soon Symfony3.1.
The legacy application already uses the directories /css/
, /js/
in the main root for managing css+js.
The problem is that Assetic will also dump it's files there after compiling css+js files from bundles. But those files are generated and should not end up in git, while the legacy files should be managed by git.
In time the legacy files will disappear completely, and everything will be handled by Assetic, but for now I have to live with both working side-by-side.
I want to reconfigure Assetic to use a different directory when generating the css+js files. It should also adjust the url's used on the webpages accordingly. Preferably by adding an additional prefix-directory.
So far I've found 2 things that might work:
1: use the write_to
configuration of the assetic-bundle. However, this appears only to influence the assetic:dump command, and should not be used for changing the output dir (according to comments). This does not change the url used to retrieve the files by the browser.
2: use the output
parameter for each and every %javascripts%
and %stylesheets%
tag in my templates. Although this does appear to control where the file goes, I find it illogical I need to do this on every tag. I should be able to configure this system-wide.
How can I adjust my Symfony and/or Assetic configuration to change the directory and web-dir used for generated css+js files?