I’ve started working with bower, and it seems really helpful. I come from a python background, and so I’m used to having virtualenv and requirements.txt.
Since I’d rather not store all my dependencies in source control if I can help it, I was wondering, how can I create a file like requirements.txt with bower?
After poking around a bit more, I have the solution.
boweruses a file calledbower.json(formerlycomponent.json) which is similar to aGemfileorrequirements.txt.It can be created manually, and will look something like this…
However, the piece that I was missing was to include the
--saveflag when installing packages inbower:Unfortunately, I do not believe there is a way to set this behaviour by default using the
.bowerrcfile.As an added tidbit, once you have a
bower.jsonfile, installing your dependencies is as simple as runningbower install.