From 572f3e06ff4dc25f5c5e14c9020bea410579186c Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 27 Apr 2014 12:53:14 -0400 Subject: [PATCH] add commonJS export in browser environment export --- src/export.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/export.js b/src/export.js index 1602bc44..e44da7cf 100644 --- a/src/export.js +++ b/src/export.js @@ -32,6 +32,8 @@ paper = new (PaperScope.inject(Base.exports, { // confuse the require.js optimizer. if (typeof define === 'function' && define.amd) define('paper', paper); +else if (typeof module === 'object') + module.exports = paper; /*#*/ } else if (__options.environment == 'node') {