javascript - Using composer to better manage my dependencies -


i trying organized files, , website php based. hence, have installed composer me achieve that.

my site has front end dependencies such jquery , question once have installed them in composer how load them page such index.php. more specific, in past individally write of js file require respective path in given page, since of them taken care of composer, how load jquery page.

below how composer looks like, , tried using require('vendor/autoload.php') doesn't seem load jquery files:

{     "name": "",     "description": "",     "authors": [         {             "name": "",             "email": ""         }     ],     "require": {         "components/jquery": "^2.1",         "stripe/stripe-php": "^2.3",         "frameworks/jquery": "^2.1"     } } 

i have heard it's best use bower manage front end dependencies, , composer back-end, , if know why. @ end of day not want write each individual require file in page , ensure each file aligned (such global jquery before specific jquery file), rather have 1 file loads requirements , push of command can updated latest version.

i'd recommend bower, if you'd dig in more css/js development. there gulp, if want out of bower. i've learned them both took while.

if need css/js files , process them yourself, i'd recommend trying composer way. assets (front-end dependencies) there composer extension https://github.com/francoispluchino/composer-asset-plugin


Comments