Bläddra i källkod

Fix Watch Core

sebavan 6 år sedan
förälder
incheckning
9f6fcddb93
1 ändrade filer med 15 tillägg och 13 borttagningar
  1. 15 13
      Tools/Gulp/tasks/gulpTasks-watchCore.js

+ 15 - 13
Tools/Gulp/tasks/gulpTasks-watchCore.js

@@ -11,28 +11,30 @@ var rmDir = require("../../NodeHelpers/rmDir");
 // Read the full config.
 var config = require("../config.json");
 
-/**
- * Clean shader ts files.
- */
-var cleanShaders = function(settings) {
-    return del([settings.srcDirectory + "**/*.fx.ts"]);
-}
+// Constants
+var module = "core";
 
 /**
- * Watch ts files and fire repective tasks.
+ * Process shader ts files.
  */
-gulp.task("watchCore", async function startWatch() {
-    var module = "core";
+gulp.task("watchCore-cleanShaders", async function startWatch() {
     var settings = config[module].build;
-    var library = config[module].libraries[0];
 
     // Clean shaders.
-    await cleanShaders(settings);
+    await del([settings.srcDirectory + "**/*.fx.ts"]);
 
     // Generate shaders.
-    gulp.src(settings.srcDirectory + "**/*.fx")
+    return gulp.src(settings.srcDirectory + "**/*.fx")
         .pipe(uncommentShaders())
-        .pipe(processShaders(true))
+        .pipe(processShaders(true));
+});
+
+/**
+ * Watch ts files and fire repective tasks.
+ */
+gulp.task("watchCore", gulp.series("watchCore-cleanShaders"), async function startWatch() {
+    var settings = config[module].build;
+    var library = config[module].libraries[0];
 
     // Generat output path.
     var outputDirectory = "../.temp/" + config.build.localDevES6FolderName + "/" + module;