r.js can be used with
node via the command line, just like middleman. I don’t know how exactly you use middleman, but incorporating another command in your workflow shouldn’t be a problem. You can find instructions on how to use
r.js from the command line here.