I have a problem using assetic and the cssrewrite filter using named assets. I have defined a named asset in the assets.yml like this:
assetic:
assets:
mycssfiles:
inputs:
- 'bundles/mybundle/css/mystyles.css'
In my twig template I use this asset with the cssrewrite filter:
{% stylesheets '@mycssfiles' output='css/styles.css' filter="cssrewrite" %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
Using this config the result of the css has an incorrect url for the images included in the css file. But if I don't use the named asset it works correctly and the url for the images are rewrited correctly. This code works fine:
{% stylesheets 'bundles/mybundle/css/mystyles.css' output='css/styles.css' filter="cssrewrite" %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
Does the cssrewrite filter not work with named assets? I know that it doesn't work with the @AppBundle sintax but I don't know if it doesn't work with named assets or I'm doing something wrong.