Procházet zdrojové kódy

inspector module definition is now correct.

Raanan Weber před 7 roky
rodič
revize
00be7b3348

+ 2 - 1
Tools/Gulp/config.json

@@ -1690,7 +1690,8 @@
                 "moduleDeclaration": {
                     "name": "INSPECTOR",
                     "module": "babylonjs-inspector"
-                }
+                },
+                "extendsRoot": true
             }
         ],
         "build": {

+ 3 - 4
Tools/Gulp/gulp-addModuleExports.js

@@ -7,7 +7,6 @@ var through = require('through2');
  */
 module.exports = function (varName, subModule, extendsRoot, externalUsingBabylon, noBabylonInit) {
     return through.obj(function (file, enc, cb) {
-
         if (typeof varName === 'string') {
             varName = {
                 name: varName,
@@ -36,11 +35,11 @@ var BABYLON = babylonDependency;
     else {
         root["${base}"]${(subModule && !extendsRoot) ? '["' + varName.name + '"]' : ''} = factory(root["BABYLON"]);
     }
-})(this, function(BABYLON) {
+})(this, function(${varName.name === 'BABYLON' ? '' : 'BABYLON'}) {
     ${String(file.contents)}
-    ${varName.name === 'BABYLON' ? `
+    ${varName.name === 'BABYLON' || varName.name === 'INSPECTOR' ? `
 var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-globalObject["${varName.name}"] = BABYLON` : ''}
+globalObject["${varName.name}"] = ${varName.name}` : ''}
     return ${base}${(subModule && !extendsRoot) ? '.' + varName.name : ''};
 });
 `;

+ 1 - 1
Tools/Gulp/gulpfile.js

@@ -480,7 +480,7 @@ var buildExternalLibrary = function (library, settings, watch) {
                 sequence.push(
                     wpBuild
                         .pipe(rename(library.output.replace(".js", library.noBundleInName ? '.js' : ".bundle.js")))
-                        .pipe(addModuleExports(library.moduleDeclaration, false, false, true))
+                        .pipe(addModuleExports(library.moduleDeclaration, false, library.extendsRoot, true))
                         .pipe(uglify())
                         .pipe(optimisejs())
                         .pipe(gulp.dest(outputDirectory))

+ 1 - 1
dist/preview release/what's new.md

@@ -96,7 +96,7 @@
 - (Viewer) Disabling templates now work correctly ([RaananW](https://github.com/RaananW))
 - AMD "define" declaration is no longer anonymous ([RaananW](https://github.com/RaananW))
 - Collision worker didn't initialize instanced meshes correctly - [#3819](https://github.com/BabylonJS/Babylon.js/issues/3819) ([RaananW](https://github.com/RaananW))
-- postMessage calls in webworkers were fixed ([RaananW](https://github.com/RaananW))
+- postMessage calls in webworkers were fixed. ([RaananW](https://github.com/RaananW))
 - fixed WebCam Texture on Firefox and Edge - [#3825](https://github.com/BabylonJS/Babylon.js/issues/3825) ([sebavan](https://github.com/sebavan))
 
 ## Breaking changes