浏览代码

Add native AMD support

Evgeny Bovykin 10 年之前
父节点
当前提交
00bf28f02a
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/Three.js

+ 5 - 6
src/Three.js

@@ -5,12 +5,11 @@
 var THREE = { REVISION: '72dev' };
 
 // browserify support
-
-if ( typeof module === 'object' ) {
-
-	module.exports = THREE;
-
-}
+if (typeof define === 'function' && define.amd) {
+    define("three", THREE);
+} else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
+    module.exports = THREE;
+ 
 
 // polyfills