seimin 2 years ago
parent
commit
92f2eeee1b
1 changed files with 7 additions and 3 deletions
  1. 7 3
      upload/development.js

+ 7 - 3
upload/development.js

@@ -35,9 +35,13 @@ function connectSSh() {
35 35
 function runTask() {
36 36
   //打包完成
37 37
   if (shell.exec(`npm run build`).code == 0) {
38
-    console.log("-----打包成功-----");
39
-    //提交上传
40
-    connectSSh();
38
+    if (shell.exec(`find dist -name '*.js' -print0 | xargs -0 gzip -k`).code == 0) {
39
+      if (shell.exec(`find dist -name '*.css' -print0 | xargs -0 gzip -k`).code == 0) {
40
+        console.log("-----打包成功-----");
41
+        //提交上传
42
+        connectSSh();
43
+      }
44
+    }
41 45
   }
42 46
 }
43 47
 runTask()