Friday, 26 December 2014

Customising what gets included from bower dependencies (Brunch)

Sometimes you'll find you need to customise which files get included from a bower dependency.

For example, when using the moment.js library, you'll see (in bower_components/moment/bower.json) that by default 'moment.js' is the only file included:

In my case, I'm using brunch to build the project and I'd prefer to include moment.min.js - plus I want to selectively pick which moment local files to include.

This turns out to be quite easy - brunch understands bower overrides, so in your projects bower.json all you have to do is include an override which tells it which files to use from your dependencies:

0 comments:

Post a Comment