In my Symfony2 project I have a number of javascript dependencies and it would be nice to have them managed along with php dependencies. Right now I am adding them to the deps file along with php dependencies and create a symlink to the web dir, for example:
//deps
[knockout-js]
git=git://github.com/SteveSanderson/knockout.git
The problem is that javascript libraries (most of them) need to be compiled from several files into one. So after installing/updating vendors, I need to go and run compilation scripts by hand. As far as I know, bin/vendors script does not support pre/post update hooks, which would solve this problem.
Anyways, how do you approach updating of javascript vendors in your projects?
There may be fancier ways... but I just use the paths in my base template like so:
{% javascripts
filter='yui_js'
'../vendor/twitter/bootstrap/js/bootstrap-tab.js'
'../vendor/harvesthq/chosen/coffee/lib/select-parser.coffee'
'../vendor/harvesthq/chosen/coffee/lib/abstract-chosen.coffee'
'../vendor/harvesthq/chosen/coffee/chosen.jquery.coffee'
'@SOTBCoreBundle/Resources/public/js/script.js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With