Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower - should I create a separate repository for bower and for development?

Tags:

bower

Is it possible to have only one repository that would be "installable" from bower?

Currently I have registered a bower package that is connected to the development repository, but when running bower install I want only the dist files to be downloaded.

I have seen people keeping two repositories - 1st for development and 2nd as a bower package repo.

Is this the desired solution - or is it possible to have a single repo ?

like image 634
g00fy Avatar asked Jun 12 '13 14:06

g00fy


2 Answers

Recent versions of bower offer the ignore property:

ignore [array]: An array of paths not needed in production that you want Bower to ignore when installing your package.

That means, all package authors have to create a bower.json file.

like image 102
koppor Avatar answered Nov 13 '22 19:11

koppor


I've answered something very close to this some hours ago: bower install take repo, not specific files in main

You cannot install just "some" files from a repo. That's not how Bower works - it will always download all files from the tag/branch.

I personally think that's okay to download everything, because this will happen only once. And you can read the main property from the Bower manifest file (bower.json).

However, if you really want to download only dist files, a very easy thing to do is:

  • Keep your development code in an non-default branch;
  • Keep your dist code in the default branch to be installed via Bower (this probably is master)

Of course, do not forget that tags should be generated on top of that branch then.

like image 23
gustavohenke Avatar answered Nov 13 '22 20:11

gustavohenke