12345678910111213141516171819202122232425 |
- console.log("> prebuild");
- console.log("> prebuild create .env.production.local");
- const buildDate = require("moment")().format("YYYY-MM-DD HH:mm:SS");
- console.log(" 构建日期为 " + buildDate);
- 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
- );
- fs.writeFileSync(
- ".env.staging.local",
- "VUE_APP_GIT_REPO_VERSION=" + buildDate + " - " + revision
- );
- console.log();
|