|
@@ -0,0 +1,20 @@
|
|
|
+console.log("> prebuild");
|
|
|
+console.log("> prebuild create .env.production.local");
|
|
|
+
|
|
|
+console.log(" 构建日期为 " + revision);
|
|
|
+const buildDate = require("moment")().format("YYYY-MM-DD HH:mm:SS");
|
|
|
+
|
|
|
+const revision = require("child_process")
|
|
|
+ .execSync("git rev-parse HEAD")
|
|
|
+ .toString()
|
|
|
+ .trim()
|
|
|
+ .slice(0, 7);
|
|
|
+const fs = require("fs");
|
|
|
+console.log(" 当前的git版本为 " + revision);
|
|
|
+
|
|
|
+fs.writeFileSync(
|
|
|
+ ".env.production.local",
|
|
|
+ "VUE_APP_GIT_REPO_VERSION=" + buildDate + " - " + revision
|
|
|
+);
|
|
|
+
|
|
|
+console.log();
|