Would it be good practice to keep only the bower.json
file and gitignore the whole bower_components
directory?
It is good to ignore /bower_components
dir and check in only bower.json
and bower-locker.bower.json
file if you create lock file using bower-locker written by Shawn Lonas.
Before bower-locker created, there was disadvantage caused by an issue of bower not having shrinkwrap capability but it can be mitigated by the above library.
Run following commands to achieve it:
npm install bower-locker -g
or
yarn global add bower-locker
then generate lock file based on existing bower.json
file by runing:
bower-locker lock
The original bower.json
file will be re-named to bower-locker.bower.json