Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower: How to patch a package or apply overrides?

Which is the best way to override or apply patches on a package, that is added to my project by using bower?

In my Sass folder I have a vendor_overrides folder, I'm ok with that, but how to handle javascripts?

Fork the project and then install that with bower?

like image 309
Sascha Avatar asked Jul 16 '14 12:07

Sascha


1 Answers

I couldn't find anyway to do this with bower.

Like you suggested. Fork and hosting your own is an option. It is mentioned in What's a good method for monkey patching Bower packages in Angular?

Another method, Which I ended up going with since I was just making a small change was to create a patch file using diff original_file modified_file > patch_file and then patch that file using patch -N file < patch_file.

Then I just make sure that in the tool chain for setting up/ building the project that that patch call occurs after bower install

like image 118
Daniel Rucci Avatar answered Oct 07 '22 01:10

Daniel Rucci