Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between .bowerrc file and bower.json file

Tags:

bower

I'm working on a project and its root directory has both files:

  • .bowerrc
  • bower.json

They both seem to configure bower, they both seem to use JSON, and my project has both files. But how are they different?

like image 535
The Red Pea Avatar asked Jun 20 '17 15:06

The Red Pea


1 Answers

The bower site explains the difference:

  • bower.json exists inside of a package. (at the root directory of a package). A package is contained code which other developers/packages can use. So if you make your own package, you need a bower.json. If you use another package, it must have a bower.json
  • .bowerrc exists either at the "user's home folder" (aka ~) and/or the "global folder" (aka /). This file configures how the bower program (the command-line utility) will work. The configurations in this file are merged with configurations you can specify other ways (i.e. arguments via the command-line) so bower knows how to run

This repository also explains the difference (emphasis added):

  • With bower.json for project configuration (like package.json or Gemfile)
  • With configuration variables for execution in general (like command-line flags)

Notice that "configuration" can be expressed in the .bowerrc file.

like image 110
The Red Pea Avatar answered Nov 18 '22 07:11

The Red Pea