diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 2e362cf9..bf8ba5a0 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -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') { diff --git a/src/paper.js b/src/paper.js index abceb5a1..c8ce54a4 100644 --- a/src/paper.js +++ b/src/paper.js @@ -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);