I use composer for PHP dependencies. I was under the impression that for front e
ID: 648206 • Letter: I
Question
I use composer for PHP dependencies. I was under the impression that for front end dependencies I should use Bower. So, I installed Bower and loaded my FE dependencies (Bootstrap, jQuery) using that. I then manually symlink to the libraries as follows:
mypc:/var/www/myproject/public/js$ ls -l
total 8
lrwxrwxrwx 1 tom tom 67 Dec 23 07:29 bootstrap.min.js -> /var/www/myproject/bower_components/bootstrap/dist/js/bootstrap.min.js
lrwxrwxrwx 1 tom tom 58 Dec 23 07:29 jquery.min.js -> /var/www/myproject/bower_components/jquery/dist/jquery.min.js
However, I notice that these are stored within a directory /bower_components just as composer dependencies are stored in /vendor. So now I have /bower_components and /vendor as well as /node_modules (for grunt and grunt plugins). So as all Bower does it bring down the repositories, upon which I need to link to them - can I not just use composer for front end libraries too?
"components/jquery": "dev-master"
"components/bootstrap": "dev-master"
.. then create symlinks to the files (e.g. .js .css) in my public/* directories? Is there any reason whhy Bower is still better for managing FE dependencies? Thanks
Explanation / Answer
No Composer is a dependency manager for PHP only while Bower is optimized for front end dependencies that can be used with not only sites built with PHP but built with other programming languages and frameworks. I would stick with Bower for front end dependency management as that's what its designed for.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.