Use named module AMD syntax for defining paper.

Closes #261.
This commit is contained in:
Jürg Lehni 2013-08-14 14:26:23 -07:00
parent 590c89840c
commit cb6833176c

View file

@ -26,8 +26,11 @@ paper = new (PaperScope.inject(Base.merge(Base.exports, {
})))();
// Support AMD (e.g. require.js)
// Use named module AMD syntax since there are other unnamed calls to define()
// inside the built library (from inlined Acorn / Esprima) that apparently
// confuse the require.js optimizer.
if (typeof define === 'function' && define.amd)
define(paper);
define('paper', paper);
/*#*/ } else if (options.node) {