Please is it advisable and best practice to use bower components within my angular CLI project(angular4) with webpack when the project is already build on node modules.
3 Answers
Bower
We'll use Bower for our front-end dependencies. Angular CLI does not install and configure Bower automatically so we'll have to add it to our projects again.
Installing Bower
You should already have Bower installed on your own machine since our curriculum has used it for the past several weeks. You can double-check by running the following command:
$ npm list -g bower
If you do not receive a version number, you'll need to install bower globally using the following command:
$ npm install bower -g
Initializing Bower
In our project directory, we can initialize Bower with the following command
$ bower init
You will be prompted with a series of questions about your project. You can simply press Enter for each to accept the default value.
This will add a new bower.json file to your directory:
{
"name": "online-store",
"description": "",
"main": "",
"authors": [
"Epicodus Student <hi@epicodus.com>"
],
"license": "MIT",
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
.gitignore
We'll also want to include /bower_components under the #dependencies section. (We'll install Bower in just a moment). Make sure to do this now:
# dependencies
/node_modules
/bower_components
For more details: https://www.learnhowtoprogram.com/javascript/angular-extended/angular-cli-bower-setup

- 97
- 1
- 11
I would advise against it. You can find pretty much everything you need as an npm package these days.
Even on the Bower.io website they are basically saying to not use it anymore for new projects.

- 3,511
- 1
- 25
- 29
Here you can find guidelines to setup bower into an Angular CLI-generated application.

- 97
- 1
- 11