فهرست منبع

Add native AMD support. Closes #6930

Evgeny Bovykin 10 سال پیش
والد
کامیت
fe6ed49dc8
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