jrburke/r.js — pull request #572 by brutaldev (2013-11-21 11:13:46+00:00)
Title: Accept an array of main config files

Hi,

The following changesets enable mixing in multiple requireJS config files via the *mainConfigFile* build setting.

The scenario we have is that there are multiple config files in higher level widgets and components and no way for the optimizer to mix multiple config file together. This change allow you to pass an array of config files and they will all be mixed together to create on large config file. The second portion is trying to get more properties mixed in (namely packages which is important to combine).

Currently alias *paths* are mixed in correctly but not *packages*. The code in **mixConfig** is not great since it looks specifically for packages and does not generically mixin arrays of objects. It also does not check for replacements like a standard mixin would deal with. Feel free to write this in such a way that it will be more dynamic and mix in array properties such as *packages*.

These changesets highlight the general idea of supporting arrays of config files while keeping it backward compatible. I've seen a few forum posts as well where developers will appreciate this small feature. Treat this as a feature request with a proof of concept (which we are currently using to optimize projects).

Thanks,
Werner