2

I know that it is considered a bad practice to commit generated files to a git repository. But how to deal with bower?

Currently my library is built into a dist/ directory which gets ignored by a .gitignore file. I don't want generated files pushed to the repository. The problem is that the library is also distributed as a bower component.

How can I reference the generated assets into my bower component when a new version got released? Should I create another repository to store those files? Should I commit those files to the git tagged version?

Florent
  • 12,310
  • 10
  • 49
  • 58

2 Answers2

4

You've already mentioned your choices. There aren't really a best way. Choose what you prefer. Either create a new repo or commit the /dist folder. Both have upsides and downsides. Creating a repo makes it more cumbersome to update and committing makes the repo more bloated.

The Bower team is working on a way to publish releases to a server, which will resolve this issue.

Sindre Sorhus
  • 62,972
  • 39
  • 168
  • 232
0

I would like to challenge the idea that committing built files is a bad practice, and I do that in this question.

About handling built files with git, check also this excellent post.

Community
  • 1
  • 1
danza
  • 11,511
  • 8
  • 40
  • 47