فهرست منبع

fix staging build

Michael Wang 6 سال پیش
والد
کامیت
92b09436c7
2فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 1 0
      package.json
  2. 6 1
      prebuild.js

+ 1 - 0
package.json

@@ -7,6 +7,7 @@
     "lint": "vue-cli-service lint",
     "start": "vue-cli-service serve",
     "mock": "json-server --watch mock/db.json",
+    "prebuild:staging": "node prebuild",
     "build:staging": "NODE_ENV=production vue-cli-service build --mode staging",
     "prebuild:prod": "node prebuild",
     "build:prod": "vue-cli-service build",

+ 6 - 1
prebuild.js

@@ -1,8 +1,8 @@
 console.log("> prebuild");
 console.log("> prebuild create .env.production.local");
 
-console.log("  构建日期为 " + revision);
 const buildDate = require("moment")().format("YYYY-MM-DD HH:mm:SS");
+console.log("  构建日期为 " + buildDate);
 
 const revision = require("child_process")
   .execSync("git rev-parse HEAD")
@@ -17,4 +17,9 @@ fs.writeFileSync(
   "VUE_APP_GIT_REPO_VERSION=" + buildDate + " - " + revision
 );
 
+fs.writeFileSync(
+  ".env.staging.local",
+  "VUE_APP_GIT_REPO_VERSION=" + buildDate + " - " + revision
+);
+
 console.log();