That's actually mentioned and explained on the r.js
docs page
(...) So, it will not find modules that are loaded via a variable name:
var mods = someCondition ? ['a', 'b'] : ['c', 'd']; require(mods);
That's because r.js
scans the scripts as text, it doesn't actually evaluate them. Take a look at its source code, you'll see there's a lot of regular expression matching going on.