Add support for AMD (e.g. require.js)

Fixes #223.
This commit is contained in:
Jürg Lehni 2013-06-11 23:50:59 -07:00
parent 94e07e77f0
commit b99d54f8c3
2 changed files with 6 additions and 0 deletions

View file

@ -15,6 +15,8 @@
* @namespace
*/
// Locally override define, so acorn.js does not export itself
var define = null;
/*#*/ if (options.parser == 'acorn') {
/*#*/ include('../../lib/acorn-min.js');
/*#*/ } else if (options.parser == 'esprima') {

View file

@ -130,3 +130,7 @@ var paper = new function() {
/*#*/ include('export.js');
return paper;
};
// Support AMD (e.g. require.js)
if (define && define.amd)
define(paper);