Jelajahi Sumber

Un HardCode Thingy

sebavan 6 tahun lalu
induk
melakukan
06af4a093b

+ 8 - 2
Tools/DevLoader/BabylonLoader.js

@@ -36,6 +36,9 @@ var BABYLONDEVTOOLS;
         var min;
         var babylonJSPath;
 
+        var localDevES6FolderName;
+        var localDevUMDFolderName;
+
         function Loader() {
             queue = [];
             esmQueue = [];
@@ -161,7 +164,7 @@ var BABYLONDEVTOOLS;
             }
 
             if (!useDist) {
-                var tempDirectory = '/.temp/localDevUMD' + module.build.distOutputDirectory;
+                var tempDirectory = '/.temp/' + localDevUMDFolderName + module.build.distOutputDirectory;
                 this.loadScript(babylonJSPath + tempDirectory + library.output);
             }
             else if (module.build.distOutputDirectory && (!testMode || !module.build.ignoreInTestMode)) {
@@ -176,7 +179,7 @@ var BABYLONDEVTOOLS;
 
         Loader.prototype.loadCoreDev = function() {
             // Es6 core import
-            this.loadESMScript("/.temp/LocalDevES6/core/legacy/legacy.js");
+            this.loadESMScript(babylonJSPath + "/.temp/" + localDevES6FolderName + "/core/legacy/legacy.js");
         }
 
         Loader.prototype.loadModule = function(module) {
@@ -222,6 +225,9 @@ var BABYLONDEVTOOLS;
             }
             getJson('/Tools/Gulp/config.json',
                 function(data) {
+                    localDevES6FolderName = data.build.localDevES6FolderName;
+                    localDevUMDFolderName = data.build.localDevUMDFolderName;
+
                     self.loadBJSScripts(data);
                     if (dependencies) {
                         self.loadScripts(dependencies);

+ 2 - 0
Tools/Gulp/config.json

@@ -2,6 +2,8 @@
     "build": {
         "outputDirectory": "../../dist/preview release",
         "tempDirectory": "../../.temp/",
+        "localDevES6FolderName": "localDevES6",
+        "localDevUMDFolderName": "localDevUMD",
         "playgroundDirectory": "../../Playground/",
         "intellisenseFile": "babylon.d.txt",
         "intellisenseSources": [

+ 6 - 3
Tools/Gulp/tasks/gulpTasks-watchCore.js

@@ -34,16 +34,19 @@ gulp.task("watchCore", async function startWatch() {
         .pipe(uncommentShaders())
         .pipe(processShaders(true))
 
+    // Generat output path.
+    var outputDirectory = config.build.tempDirectory + config.build.localDevUMDFolderName + "/" + module;
+
     // Clean Folder.
-    rmDir('../../.temp/LocalDevES6/core');
+    rmDir(outputDirectory);
 
     // Launch TSC.
     const options = {
-        cwd: "../../src/",
+        cwd: settings.srcDirectory,
         async: true,
         verbose: true
     };
-    shelljs.exec("tsc --isolatedModules true --declaration false --target es5 --module es2015 --outDir ../.temp/es6LocalDev/core -w", options, function(code, stdout, stderr) {
+    shelljs.exec(`tsc --isolatedModules true --declaration false --target es5 --module es2015 --outDir ${outputDirectory} -w`, options, function(code, stdout, stderr) {
         if (stderr) {
             console.log(stderr);
         }

+ 1 - 1
Tools/Gulp/tasks/gulpTasks-watchLibraries.js

@@ -49,7 +49,7 @@ gulp.task("watchLibraries", function startWatch() {
                         .pipe(processShaders(false))
                 );
 
-                var outputDirectory = config.build.tempDirectory + "localDevUMD" + settings.distOutputDirectory;
+                var outputDirectory = config.build.tempDirectory + config.build.localDevUMDFolderName + settings.distOutputDirectory;
                 tasks.push(
                     webpackStream(wpConfig, webpack).pipe(gulp.dest(outputDirectory))
                 );