I already have all needed js files in web folder, when I use assetic:dump command it produces concatenated file and copies all other files two the same directory. How can I avoid this?
code in twig template:
{% block headerscripts %}
{% javascripts output='assetic/vendors_header.js'
'vendor/jquery-1.10.2.min.js'
'vendor/html5shiv.js'
%}
<script src="{{ asset('assetic/vendors_header.js' ~ assets_version) }}"></script>
{% endjavascripts %}
{% endblock %}
You added in a comment:
in dev environment. when i use "assets_url" i get all script separetly in browser instead o one compiled gifile
That's the expected behaviour in dev
environment: files are not concatenated in order to ease debugging.
In the dev
environment, each file is still served individually, so that you can debug problems more easily. However, in the prod
environment (or more specifically, when the debug
flag is false
), this will be rendered as a single script
tag, which contains the contents of all of the JavaScript files.
Source: Symfony2 official documentation > How to Use Assetic for Asset Management> Combining Assets.