May 16, 2016

How to use Bower as frontend dependencies manager for web project based on Laravel 5.x?

1. Install bower globally
$ npm install -g bower
2. We need a bower.json file to get started. The following command will create a file called bower.json.
$ bower init
Or we can create manually in the root of your directory with the following content:
{
  "name": "your-project"
}
3. Add .bowerrc
By default Bower installs into /bower_components, but we want our dependencies in public directory. Create a file named .bowerrc in our root directory with following content:
{
  "directory": "public/bower"
} 
4. Install our front-end dependencies. For example:
$ bower install angular --save
$ bower install jquery --save
Some Related topics:
https://laracasts.com/discuss/channels/laravel/assets-not-accessible-laravel-51

No comments:

Post a Comment