pmcelhaney/raphael — comment on commit e443933a9582499205a6eb2dad64618981edadd1
File:  line 0
By jrburke:

Instead of using almond, this kind of use of define() could just use a simple

function def(factory) { factory(R); }

stub, where R is the raphael object created in core. If you use r.js 1.0.6, you can have an onBuildWrite function that rewrites the define() calls to the def() call that just passes the factory function. Here is a reference for that:

https://github.com/jrburke/mvclib-template/blob/master/tools/build.js

It is a bit more complex and you can ignore the onBuildRead thing -- that example project was dealing with node-native source files and had to adapt them to use define() for the build. But the onBuildWrite stuff is useful, in addition to the use of the wrap arg to include a wrap.start that has the simple def() definition.

It also might be useful to keep the make file, and have it just call r.js, passing include= for anything that is additional in the other files it builds.