Browse Source

cleanup node_modules before deploying to netlify

Raanan Weber 7 năm trước cách đây
mục cha
commit
ce104ae298
1 tập tin đã thay đổi với 14 bổ sung1 xóa
  1. 14 1
      Tools/Gulp/gulpfile.js

+ 14 - 1
Tools/Gulp/gulpfile.js

@@ -635,7 +635,7 @@ gulp.task("build-custom", function (cb) {
  * Do it all.
  */
 gulp.task("typescript-all", function (cb) {
-    runSequence("typescript", "typescript-libraries", cb);
+    runSequence("typescript", "typescript-libraries", "netlify-cleanup", cb);
 });
 
 /**
@@ -744,6 +744,19 @@ gulp.task("clean-JS-MAP", function () {
     ], { force: true });
 });
 
+gulp.task("netlify-cleanup", function () {
+    //set by netlify
+    if (process.env.REPOSITORY_URL) {
+        return del([
+            "../../inspector/node_modules/**/*", "../../gui/node_modules/**/*",
+            "../../Viewer/node_modules/**/*"
+        ], { force: true });
+    }
+    else {
+        return true;
+    }
+})
+
 // this is needed for the modules for the declaration files.
 gulp.task("modules-compile", function () {
     var tsResult = gulp.src(config.typescript)