> IMHO, the best option is still boilerplate (to conditionally turn an AMD into 
> a Node.js module):
>     ({ define: typeof define === "function"
>         ? define
>         : function(A,F) { module.exports = F.apply(null, A.map(require)) } }).
>     define([ "./module1", "./module2" ],
>         function (module1, module2) {
>             return ...
>         }
>     );
> 
> [1] http://www.2ality.com/2011/11/module-gap.html
> 
> 
> I like this adapter, and have just changed 
> <http://code.google.com/p/es-lab/source/browse/trunk/src/ses/amdTest3.js> to 
> test that it works with our simple AMD Loader in translation-free SES-on-ES5 
> (similar to the above, at 
> <http://code.google.com/p/es-lab/source/browse/trunk/src/ses/makeSimpleAMDLoader.js>).
>  You can run this test by visiting 
> <http://es-lab.googlecode.com/svn/trunk/src/ses/explicit.html> in a modern 
> browser. If you see the line "AMD loader test...succeeded", then it did.

As an aside, one benefit of the above boilerplate is that it is just a prefix 
(easier to copy and paste than solutions that are wrapped around an AMD).

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to