broccolijs / broccoli-funnel

MIT License
66 stars 37 forks source link

Support dynamic files filtering? #25

Closed timmfin closed 9 years ago

timmfin commented 9 years ago

Not sure where to put this, but I figured I'd create an issue to see if there was any interest from others.

In my (complex) internal build setup, I needed the files option to broccoli-filter to be dynamic. More specifically, I needed it to be a function that could return a different list of files every rebuild.

My guess is that kind of behavior is likely out-of-scope for broccoli-funnel, but just in case I'm wrong (or anyone else that needs that functionality stumbles along this), here is my forked branch that enables it: https://github.com/broccolijs/broccoli-funnel/compare/master...timmfin:dynamic-filters.

ps: The reason I needed this is because I'm building a tree of file dependency info during the broccoli build (via the CalculateDependenciesFilter in broccoli-dependencies) and then I want to use that info later in the files filter for a funnel. And since the dependency info isn't generated until after the the CalculateDependenciesFilter filter has run, I cannot pass broccoli-funnel the files array at Brocfile.js "eval-time".

stefanpenner commented 9 years ago

@timmfin this actually sounds totally reasonable. Would accept a PR.

timmfin commented 9 years ago

Great, I'll try and get to it in the next few days.

stefanpenner commented 9 years ago

:)

timmfin commented 9 years ago

Here ya go: https://github.com/broccolijs/broccoli-funnel/pull/36