I generate my file with code like this:
{% block head_stylesheets %}
{% stylesheets
filter='?uglifycss'
'@MyBundle/Resources/public/less/myfile.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen"/>
{% endstylesheets %}
{% endblock head_stylesheets %}
It dumps a file named like this: c543k540_myfile_1.css
This file is composed of the asset name followed by the filename: {assetName}_{filename}.css
How can I customize the output in keeping the asset name in the output?
{% block head_stylesheets %}
{% stylesheets
output="css/mynewfilename.{assetName}.css" // <--- Here
filter='?uglifycss'
'@MyBundle/Resources/public/less/myfile.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen"/>
{% endstylesheets %}
{% endblock head_stylesheets %}
Update to clarify
I know that if I use the name option, in prod it will compile to myouputname.css
but what I would like to have in debug/dev environment is following the bellow code something like myfile_myouputname_1.css
{% block head_stylesheets %}
{% stylesheets
name="myouputname" // <--- Here
filter='?uglifycss'
'@MyBundle/Resources/public/less/myfile.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen"/>
{% endstylesheets %}
{% endblock head_stylesheets %}
Thanks for your reply.
dev
environement the command dumps the chunks for each asset and also the combined file. You should find two files c543k540_myfile_1.css and c543k540.css. If you dump the assets forprod
environment withbin/console assetic:dump --env=prod --no-debug
it should create only the main file *c543k540.css`. Remember to clear the cache before dumping in prod. – Mehalickname="foo"
, andoutput="mynewfilename.{assetName}.css"
, you expect a file namedmynewfilename.foo.css
? – Gegenschein