Sascha
Sascha

Reputation: 898

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?

Upvotes: 7

Views: 1404

Answers (1)

Daniel Rucci
Daniel Rucci

Reputation: 2872

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

Upvotes: 2

Related Questions