浏览代码

global BABYLON namespace defined

Raanan Weber 7 年之前
父节点
当前提交
8308d54b0a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Tools/Gulp/gulp-babylonModule.js

+ 5 - 1
Tools/Gulp/gulp-babylonModule.js

@@ -71,7 +71,11 @@ if(typeof require !== 'undefined'){
 
         let exportsText = '';
         if (moduleName === "core") {
-            exportsText = `(function() { module.exports = BABYLON; })();
+            exportsText = `(function() {
+    var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
+    globalObject["BABYLON"] = BABYLON;
+    module.exports = BABYLON; 
+})();
 }`
         }
         else {